From nobody Tue Feb 21 11:43:20 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 4PLcqf5Wfrz3sG46 for ; Tue, 21 Feb 2023 11:43:26 +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) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLcqf1Pfjz44yT for ; Tue, 21 Feb 2023 11:43:26 +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 26A5D185F; Tue, 21 Feb 2023 12:43:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1676979803; 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; l=5114; bh=MEucZMW+GE9u8J6zK0s4s1gttUgLs4NlMpDVynLpL0g=; b=ecWDtw58Ko6tQIPEDhKHNjFGXHqz2z5d2QuIpXkCFph9LnkW56PSVoGli1BKa3ci hfrUs2XWUuCaYVlt6+3NPyN7CSmt9QFKCP4/PMeLyrvsuuVnFyQnehEyEp7T0J69cNY 1aAkd++4oxlT3i5G1XVz1GjZSzQvMzCj6heXGUQPzK9K1HJ2fwcIKWEdOEWod5Tzod4 qgTKwUDnRs+ROR2g1oMwUXugmI9etAUmow2tG2RFY79i0gGn7DrWhe6cETwcj9XakKK 1F3oULkc4fl7XEP4sFOWfg2i9tCMVsBjfuJasgGkXpTz0xfTk3ZMLP6+0VjQ3kyTUFz bgIA1LNXKg== Date: Tue, 21 Feb 2023 12:43:20 +0100 (CET) From: Sysadmin Lists To: Freebsd Questions Cc: jin guojun Message-ID: <1141880522.223846.1676979800157@ichabod.co-bxl> In-Reply-To: References: <1600449078.170379.1676939080787@fidget.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: multipart/alternative; boundary="----=_Part_223843_1098578769.1676979800156" X-Mailer: ContactOffice Mail X-ContactOffice-Account: com:312482426 X-Rspamd-Queue-Id: 4PLcqf1Pfjz44yT 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 ------=_Part_223843_1098578769.1676979800156 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Feb 20, 2023 at 5:13 PM, jin guojun wrote: Without knowing what hidden character(s) in those files, how one can guess = what happened. hexdump -C file_{1,2} can show what is the real difference, which may help = to understand what is going on with awk print. -Jin On Mon, Feb 20, 2023 at 4:25 PM Sysadmin Lists wrote: $ diff file_{1,2}=C2=A0=20 1,2c1,2 < https://github.com/ < https://github.com/ --- > https://github.com/ > https://github.com/ $ awk '{ print $0 " abc " }' file_{1,2}=C2=A0=20 =C2=A0abc ://github.com/ =C2=A0abc ://github.com/ https://github.com/ abc=20 https://github.com/ abc Thanks. I found the answer already, but this would also have lead me in the right direction, too. It shows a difference (single trailing dot verses double-dot) for the two f= iles: $ hexdump -C file_{1,2}=C2=A0 00000000=C2=A0 68 74 74 70 73 3a 2f 2f=C2=A0 67 69 74 68 75 62 2e 63=C2=A0 = |https://github.c| 00000010=C2=A0 6f 6d 2f 0d 0a 68 74 74=C2=A0 70 73 3a 2f 2f 67 69 74=C2=A0 = |om/..https://git| 00000020=C2=A0 68 75 62 2e 63 6f 6d 2f=C2=A0 0d 0a 68 74 74 70 73 3a=C2=A0 = |hub.com/..https:| 00000030=C2=A0 2f 2f 67 69 74 68 75 62=C2=A0 2e 63 6f 6d 2f 0a 68 74=C2=A0 = |//github.com/.ht| 00000040=C2=A0 74 70 73 3a 2f 2f 67 69=C2=A0 74 68 75 62 2e 63 6f 6d=C2=A0 = |tps://github.com| 00000050=C2=A0 2f 0a=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|/.| 00000052 -- Sent with https://mailfence.com Secure and private email ------=_Part_223843_1098578769.1676979800156 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
=
On Feb 20, 2023 at 5:13 PM, jin guojun <jguojun@gmail.com> wrote= :
">
Without knowing what = hidden character(s) in those files, how one can guess what happened.
<= div>
hexdump -C file_{1,2} can show what is the real differen= ce, which may help to understand what is going on with awk print.

-Jin

On Mon, Feb 20, 2023 at 4:25 PM Sysadmin Lists <sysadmin.lists@mailfence.com> wrote= :

$ diff file_{1,2} 
1,2c1,2
< h= ttps://github.com/
< h= ttps://github.com/
---
> h= ttps://github.com/
> h= ttps://github.com/

$ awk '{ print $0 " abc " }' file_{1,2} 
 abc ://github.com/
 abc ://github.com/
https:= //github.com/ abc
https:= //github.com/ abc


Thanks. I foun= d the answer already, but this would also have lead me in the
rig= ht direction, too.

It shows a difference (single t= railing dot verses double-dot) for the two files:
$ hexdump -C file_{1,2} 
00000000  68 = 74 74 70 73 3a 2f 2f  67 69 74 68 75 62 2e 63  |https://github.c|=
00000010  6f 6d 2f 0d 0a 68 74 74  70 73 3a 2f 2f 67 6= 9 74  |om/..https://git|
00000020  68 75 62 2e 63 6f 6d= 2f  0d 0a 68 74 74 70 73 3a  |hub.com/..https:|
000000= 30  2f 2f 67 69 74 68 75 62  2e 63 6f 6d 2f 0a 68 74  |//git= hub.com/.ht|
00000040  74 70 73 3a 2f 2f 67 69  74 68 7= 5 62 2e 63 6f 6d  |tps://github.com|
00000050  2f 0a&nb= sp;                     &= nbsp;                    =  |/.|
00000052
--=20 Sent with https://mailfence.com =20 Secure and private email ------=_Part_223843_1098578769.1676979800156--