Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Feb 2023 13:06:04 +0100 (CET)
From:      Sysadmin Lists <sysadmin.lists@mailfence.com>
To:        Freebsd Questions <freebsd-questions@freebsd.org>
Cc:        =?utf-8?Q?Andreas_Kusalananda_K=C3=A4h=C3=A4ri?= <andreas.kahari@abc.se>
Subject:   Re: BSD-awk print() Behavior
Message-ID:  <1200764932.226141.1676981164445@ichabod.co-bxl>
In-Reply-To: <Y/Sxpa5H6bRYqiSI@harpo.local>
References:  <1600449078.170379.1676939080787@fidget.co-bxl> <Y/SZfSO1CdhIvVUD@harpo.local> <1653727721.225143.1676980394881@ichabod.co-bxl> <Y/Sxpa5H6bRYqiSI@harpo.local>

next in thread | previous in thread | raw e-mail | index | archive | help
> ----------------------------------------
> From: Andreas Kusalananda K=C3=A4h=C3=A4ri <andreas.kahari@abc.se>
> Date: Feb 21, 2023, 3:57:25 AM
> To: Sysadmin Lists <sysadmin.lists@mailfence.com>
> Cc: Freebsd Questions <freebsd-questions@freebsd.org>
> 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 <andreas.kahari@abc.se>
> > > Date: Feb 21, 2023, 2:14:21 AM
> > > To: Sysadmin Lists <sysadmin.lists@mailfence.com>
> > > Cc: Freebsd Questions <freebsd-questions@freebsd.org>
> > > 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1200764932.226141.1676981164445>