Page 2 of 2

Re: Strange behaviour with tail command

Posted: 17. May 2023, 10:01
by percoco2000
Now i'm wondering why your last command didn't give you an error........

Re: Strange behaviour with tail command

Posted: 17. May 2023, 14:08
by laprjns
percoco2000 wrote: 17. May 2023, 10:01 Now i'm wondering why your last command didn't give you an error........
Because I did this;
gapan wrote: 12. May 2023, 23:36 You can override it with:

Code: Select all

export _POSIX2_VERSION=200809
Note that it’s not persistent.

Re: Strange behaviour with tail command

Posted: 18. May 2023, 07:27
by percoco2000
Well ,... Tankyou, my script now works well.
But i still think it's a bug. The old style compatibility is meant to accept options like "tail -20", without "-c". This explains also why -c -2 works, and not -c +2.

Re: Strange behaviour with tail command

Posted: 18. May 2023, 10:00
by laprjns
From gapan post
# Compilation with glibc version later than 2.3.2 needs the environment
# variable DEFAULT_POSIX2_VERSION set to 199209.
# Without that line, the coreutils will start complaining about 'obsolete'
# command switches, like "tail -20" will be considered obsolete.
# This behaviour breaks many other packages... the 'obsolete' parameters are
# too commonly used to disregard them. Better to stick with the older more
# widely accepted standards until things begin to demand the new way.

Re: Strange behaviour with tail command

Posted: 18. May 2023, 14:43
by percoco2000
Saw them... But in this specific case it doesn't complain, it trows out a "file not found error.."