On 01/15/2015 04:55 PM, prateek goyal wrote:
So even if I execute following command, it gives same result:

prateek@prateek-pc:~/Documents/awk$ env POSIXLY_CORRECT=1 echo --help
--help

That is exactly what Eric said before: POSIX mandates to literally
output the string "--help" - which coreutils' echo does if the variable
POSIXLY_CORRECT is set.  Otherwise, the implementation extends the
functionality and adheres to GNU standards which mandates to honor
the "--help" option to output the usage message:

  $ env --unset=POSIXLY_CORRECT echo --help
  Usage: ...

Maybe you were confused by the use of the 'env' utility.
You'll get the same by specifying the echo with it's absolute path:

  $ which echo
  /usr/bin/echo
  $ unset POSIXLY_CORRECT
  $ /usr/bin/echo --help
  Usage: [...]

Have a nice day,
Berny



Reply via email to