From nobody Tue Feb 21 11:57:25 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLd7s6hQ9z3sGlH for ; Tue, 21 Feb 2023 11:57:29 +0000 (UTC) (envelope-from andreas.kahari@abc.se) Received: from hekla.abc.se (hekla.abc.se [158.174.61.227]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLd7s247Wz47c9 for ; Tue, 21 Feb 2023 11:57:29 +0000 (UTC) (envelope-from andreas.kahari@abc.se) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=default; bh=X5PMNMusz4 nSnCNpfn7blk1EW0Klgm/detLDyT6Wksk=; h=in-reply-to:references:subject: cc:to:from:date; d=abc.se; b=PGiS6tQS6zArH27GB/KwHNyRm+on27kHLt3iS5z1+ rqJb9iKgUuk0iyNvDOhg6ZRJdDx6fNmzDazHIrBqTiQUYt/vlsFxUX1mB4e7QJwy7ZOWjt bGkyzR1Y+IhW1Y2fqljIUpr4Swyssu3KZNgF9crBnP3BDjyFL8DLEedUrRneaCcT8YxR+G a/ATKCDYrOdimN2szZgKd1wBbof3pgmu1JA7r4PkXtiMtyEQb09OmIah7Nb/LWl4/uImg2 WrY1lwwqe7moCDal1L295QDsqwjAOnjoI0WsBndnuztl50SyphT+QqxTxJOK8tQay8jDDa ksaFHtXkpFI05NtwJn9nQ== Received: from harpo.local (83-233-144-161.cust.bredband2.com [83.233.144.161]) by hekla.abc.se (OpenSMTPD) with ESMTPSA id 6c50c848 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 21 Feb 2023 12:57:26 +0100 (CET) Date: Tue, 21 Feb 2023 12:57:25 +0100 From: Andreas Kusalananda =?utf-8?B?S8OkaMOkcmk=?= To: Sysadmin Lists Cc: Freebsd Questions Subject: Re: BSD-awk print() Behavior Message-ID: Mail-Followup-To: Sysadmin Lists , Freebsd Questions References: <1600449078.170379.1676939080787@fidget.co-bxl> <1653727721.225143.1676980394881@ichabod.co-bxl> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1653727721.225143.1676980394881@ichabod.co-bxl> X-Rspamd-Queue-Id: 4PLd7s247Wz47c9 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8473, ipnet:158.174.0.0/16, country:SE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, Feb 21, 2023 at 12:53:14PM +0100, Sysadmin Lists wrote: > > ---------------------------------------- > > From: Andreas Kusalananda Kähäri > > Date: Feb 21, 2023, 2:14:21 AM > > To: Sysadmin Lists > > Cc: Freebsd Questions > > Subject: Re: BSD-awk print() Behavior > > > > > > On Tue, Feb 21, 2023 at 01:24:41AM +0100, Sysadmin Lists wrote: [cut] > > Yes, because Vim automatically interprets DOS text files as ordinary > > text. I'm asssuming that while editing file_1 in Vim, you see "[dos]" > > at the bottom of the screen? > > > > > > Good explanation. I found the hidden character before reading your email using > `cat -e' which printed the ^M character, but didn't know awk could move the > cursor around like that. Sounds like a useful (and dangerous) hack. > > $ cat -e file_{1,2} > https://github.com/^M$ > https://github.com/^M$ > https://github.com/$ > https://github.com/$ > > vim does indeed say [dos] at the bottom of file_1. Now I know sqlite3 creates > dos files even on unix-like systems. I'm guessing that if you look in your database, the data there is inserted with carriage-returns at the end of the strings. It's not sqlite3 that creates DOS files, it's just giving you what was inserted into the tables. If you want to track down where the carriage-returns came from originally, you have to search further upstream. -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .