bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] Inconsistent results between mac and linux when $'\t' is used


From: Peng Yu
Subject: [bug-gawk] Inconsistent results between mac and linux when $'\t' is used in a cmmand
Date: Tue, 29 Nov 2016 09:31:23 -0600

Hi,

I have the following awk code.

~$ cat main.awk
{
  print | "sort -t $'\t' -k 1,1n"
}

When I run it on Mac, it works just fine.

~$ uname
Darwin
~$ gawk --version|head -n 1
GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.5, GNU MP 6.1.1)
~$ seq 3| gawk -f ./main.awk
1
2
3

But when I run it on linux. it does not work as expected.

~$ uname
Linux
~$ gawk --version|head -n 1
GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.5, GNU MP 6.1.1)
~$ seq 3 | gawk -f ./main.awk
sort: multi-character tab ‘$\t’

Does anybody know why there is a difference between mac and linux? Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]