From nobody Tue Feb 21 12:06:04 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 4PLdKr6kd2z3sGnt for ; Tue, 21 Feb 2023 12:06:08 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Received: from wilbur.contactoffice.com (wilbur.contactoffice.com [212.3.242.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLdKr4G0gz49m3 for ; Tue, 21 Feb 2023 12:06:08 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Authentication-Results: mx1.freebsd.org; none Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36]) by wilbur.contactoffice.com (Postfix) with ESMTP id 78C221B74; Tue, 21 Feb 2023 13:06:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1676981167; s=20210208-e7xh; d=mailfence.com; i=sysadmin.lists@mailfence.com; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; l=2461; bh=5/eXfBFLIbw+3KKf/4JKo6+qVy8kUnGuSdDzN2G8BL8=; b=jzNisEj9TTaJG+1Z//3AxSObX6CsNS8hyj+hxvBlP6jZHgnYiPWtwAQdyxFoHLtB KlEUTei45v7j9uWVi1fDBhbuXoOMUuItKOux5d9udZeQxwGuFI1cpurbbMFG8821PsJ 402UjV+UbgobUo2oCCk4EkaoKxLwKVPz4GmPmFgFTCv2tOocX7Aw9GqjEHStz2gkxYI ZfPowNyjo1s23+ts6dzgTu3zPpw/PxBInLTmORrQqTCeL8AGUCcKYfu8/+g0DxqMe46 W6Sz9uhXg+bcC2ad/lbO62gdImGLxiU8+xhwvZG453u0TtQ5DOeA6Rdsiob5F14yDzo f6dR6pN6mg== Date: Tue, 21 Feb 2023 13:06:04 +0100 (CET) From: Sysadmin Lists To: Freebsd Questions Cc: =?utf-8?Q?Andreas_Kusalananda_K=C3=A4h=C3=A4ri?= Message-ID: <1200764932.226141.1676981164445@ichabod.co-bxl> In-Reply-To: References: <1600449078.170379.1676939080787@fidget.co-bxl> <1653727721.225143.1676980394881@ichabod.co-bxl> Subject: Re: BSD-awk print() Behavior 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-Transfer-Encoding: quoted-printable X-Mailer: ContactOffice Mail X-ContactOffice-Account: com:312482426 X-Rspamd-Queue-Id: 4PLdKr4G0gz49m3 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:10753, ipnet:212.3.242.64/26, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > ---------------------------------------- > From: Andreas Kusalananda K=C3=A4h=C3=A4ri > Date: Feb 21, 2023, 3:57:25 AM > To: Sysadmin Lists > Cc: Freebsd Questions > Subject: Re: BSD-awk print() Behavior >=20 >=20 > On Tue, Feb 21, 2023 at 12:53:14PM +0100, Sysadmin Lists wrote: > > > ---------------------------------------- > > > From: Andreas Kusalananda K=C3=A4h=C3=A4ri > > > Date: Feb 21, 2023, 2:14:21 AM > > > To: Sysadmin Lists > > > Cc: Freebsd Questions > > > Subject: Re: BSD-awk print() Behavior > > >=20 > > >=20 > > > 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? > > >=20 > > >=20 > >=20 > > Good explanation. I found the hidden character before reading your emai= l 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. > >=20 > > $ cat -e file_{1,2}=20 > > https://github.com/^M$ > > https://github.com/^M$ > > https://github.com/$ > > https://github.com/$ > >=20 > > vim does indeed say [dos] at the bottom of file_1. Now I know sqlite3 c= reates > > dos files even on unix-like systems. >=20 > 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. >=20 Nope, I'm good. This was just a one-off task I needed to perform. I managed= to complete it using yank-and-paste in vim, but wouldn't have been able to mentally move on without knowing what was "breaking" in awk. Turns out it wasn't awk, and I learned a few new tricks tracking this issue down -- whic= h is what makes this kind of work fun. Thanks again for the help. (Now that I think of it, the carriage-returns are inserted by the web brows= er=20 of course.) --=20 Sent with https://mailfence.com =20 Secure and private email