3 ms·
Every contemporary AWK supports -v. Real AWK from UNIX®️ supported -v since at least the '80's.
by Annatar 7y ago
Every contemporary AWK supports -v. Real AWK from UNIX®️ supported -v since at least the '80's.
- 3xblah 7y agoTrue. But there are differences when -v is used, as opposed to FS. Try this, where "nawk" is Lucent awk used by BSD cat > 1.awk << eof { print $ARGC } eof echo|nawk -f 1.awk FS=":" echo|gawk -f 1.awk FS=":" echo|nawk -f 1.awk -v FS=":" echo|gawk -f 1.awk -v FS=":"
- Annatar 7y agoThat is not how FS is set; It's set with -F. And there is actually no need to use -v, passing variables at the end works consistently across all AWK's and always has: echo "" | awk '{print Bla;}' Bla="Hello."