bash-otp icon indicating copy to clipboard operation
bash-otp copied to clipboard

awk: field separator FS is empty on macOS 13

Open osopolar opened this issue 2 years ago • 2 comments

I get following message on macOS 13:

awk: field separator FS is empty

osopolar avatar Jun 30 '23 14:06 osopolar

need more info

poolpog avatar Jul 02 '23 16:07 poolpog

See commit 0213325c474f86070db91516c7f1499af301b5ae in linked PR.

That is what awk says on macOS. See also https://stackoverflow.com/a/31135987:

Note that the standards say that the results are unspecified if an empty string is assigned to FS. Some versions of awk will produce the output you showed above in your example. The version of awk on OS/X issues the warning and output.

And in https://unix.stackexchange.com/a/417122/173958 I found:

With Brian Kernighan's awk or the ones based on it like on FreeBSD or OpenBSD, note that while an empty FS or an empty third argument passed to split() causes the string to be split into its individual characters (well, bytes, see below), awk -F '' returns an error (awk -v FS= is OK though).

osopolar avatar Jul 02 '23 17:07 osopolar