Date: Tue, 21 Feb 2023 12:43:20 +0100 (CET) From: Sysadmin Lists <sysadmin.lists@mailfence.com> To: Freebsd Questions <freebsd-questions@freebsd.org> Cc: jin guojun <jguojun@gmail.com> Subject: Re: BSD-awk print() Behavior Message-ID: <1141880522.223846.1676979800157@ichabod.co-bxl> In-Reply-To: <CAE6yT5unTF5S=gt3oFy2-MhAdv-rDO660Dw4Y0O_AFQwSLnp%2Bw@mail.gmail.com> References: <1600449078.170379.1676939080787@fidget.co-bxl> <CAE6yT5unTF5S=gt3oFy2-MhAdv-rDO660Dw4Y0O_AFQwSLnp%2Bw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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.
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 <sysadmin.lists@mailfence.com> wrote:
$ diff file_{1,2}
1,2c1,2
< https://github.com/
< https://github.com/
---
> https://github.com/
> https://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 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 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 69 74 |om/..https://git|
00000020 68 75 62 2e 63 6f 6d 2f 0d 0a 68 74 74 70 73 3a |hub.com/..https:|
00000030 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 0a 68 74 |//github.com/.ht|
00000040 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d |tps://github.com|
00000050 2f 0a |/.|
00000052
-- Sent with https://mailfence.com Secure and private email
[-- Attachment #2 --]
<div style='font-family:Times New Roman; color:#000000; font-size:18px;'><div>On Feb 20, 2023 at 5:13 PM, jin guojun <jguojun@gmail.com> wrote:<blockquote type="cite" cite="<CAE6yT5unTF5S=gt3oFy2-MhAdv-rDO660Dw4Y0O_AFQwSLnp+w@mail.gmail.com>"><div dir="ltr"><div>Without knowing what hidden character(s) in those files, how one can guess what happened.</div><div><br></div><div>hexdump -C file_{1,2} can show what is the real difference, which may help to understand what is going on with awk print.</div><div><br></div><div>-Jin<br></div></div><br><div class=""><div dir="ltr" class="">On Mon, Feb 20, 2023 at 4:25 PM Sysadmin Lists <<a href="mailto:sysadmin.lists@mailfence.com">sysadmin.lists@mailfence.com</a>> wrote:<br></div><blockquote class="" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
$ diff file_{1,2} <br>
1,2c1,2<br>
< <a href="https://github.com/" rel="noreferrer" target="_blank">https://github.com/</a><br>
< <a href="https://github.com/" rel="noreferrer" target="_blank">https://github.com/</a><br>
---<br>
> <a href="https://github.com/" rel="noreferrer" target="_blank">https://github.com/</a><br>
> <a href="https://github.com/" rel="noreferrer" target="_blank">https://github.com/</a><br>
<br>
$ awk '{ print $0 " abc " }' file_{1,2} <br>
abc ://<a href="http://github.com/" rel="noreferrer" target="_blank">github.com/</a><br>
abc ://<a href="http://github.com/" rel="noreferrer" target="_blank">github.com/</a><br>
<a href="https://github.com/" rel="noreferrer" target="_blank">https://github.com/</a> abc <br>
<a href="https://github.com/" rel="noreferrer" target="_blank">https://github.com/</a> abc<br>
<br></blockquote></div></blockquote><div><br></div><div><div>Thanks. I found the answer already, but this would also have lead me in the</div><div>right direction, too.</div><div><br></div><div>It shows a difference (single trailing dot verses double-dot) for the two files:</div></div></div><div><br></div><div><div>$ hexdump -C file_{1,2} </div><div>00000000 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 |https://github.c|</div><div>00000010 6f 6d 2f 0d 0a 68 74 74 70 73 3a 2f 2f 67 69 74 |om/..https://git|</div><div>00000020 68 75 62 2e 63 6f 6d 2f 0d 0a 68 74 74 70 73 3a |hub.com/..https:|</div><div>00000030 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 0a 68 74 |//github.com/.ht|</div><div>00000040 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d |tps://github.com|</div><div>00000050 2f 0a |/.|</div><div>00000052</div></div></div>
--
Sent with https://mailfence.com
Secure and private email
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1141880522.223846.1676979800157>
