bug-gawk
[Top][All Lists]
Advanced

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

-F fs_val handles backslash-newline differently, compared to -v FS=val a


From: Denys Vlasenko
Subject: -F fs_val handles backslash-newline differently, compared to -v FS=val and FS=val
Date: Thu, 8 Jun 2023 11:22:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

GNU awk 5.1.1

gawk -F '\
a' 'BEGIN { print "FS1=" FS }'

gawk -v FS='\
a' 'BEGIN { print "FS2=" FS }'

echo | gawk '{ print "FS3=" FS }' FS='\
a'

The first command treats "backslash+newline" as backslash:

FS1=\a

The second and third commands treat the same as empty string:

FS2=a
FS3=a

I think it would be better if all forms have the same rules.




reply via email to

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