Re:A peculiarity of the GNU Coreutils version of 'test' and '['
by chungy on Sunday November 26, 2023 @02:46AM
(#38419922)
I tend to install coreutils on FreeBSD. Besides some minor annoyance with every command being prefixed with "g", some of the programs work a bit nicer than the FreeBSD-shipped versions (or some Linux-centric programs just want the coreutils versions...).
[ Parent
| on HN ]
Re:A peculiarity of the GNU Coreutils version of 'test' and '['
by 1500100900 on Sunday November 26, 2023 @03:17AM
(#38420039)
I'd be interested in learning which commands you have in mind and what specifically is a bit nicer about their coreutils implementation.
Re:A peculiarity of the GNU Coreutils version of 'test' and '['
by orra on Sunday November 26, 2023 @04:45AM
(#38420415)
In GNU utilities, option arguments can come after (or between) positional arguments. Personally I find this small convenience invaluable, because I'm used to it.
Re:A peculiarity of the GNU Coreutils version of 'test' and '['
by usr1106 on Sunday November 26, 2023 @06:44AM
(#38420891)
Oh, I had no idea that GNU utilities allow this.
As a Unix graybeard I always place options first. Options last feels like Windows command prompt, so nothing I want to see...
I always tell younger colleagues who place options in the end, it might work with some commands, but just don't do it. I did not know that "some" includes all of GNU coreutils? A single common code style is a virtue, even in interactive use if there are onlookers. So I guess I will continue to point it out.
Re:A peculiarity of the GNU Coreutils version of 'test' and '['
by mike_hock on Sunday November 26, 2023 @06:55AM
(#38420947)
Even many command line parsing libraries support it and scan the entire argv for options. You should always terminate the options with "--" if it's in a script and any of the positional arguments are variables that might or might not start with a dash.