Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

On my OS X 10.5.8 system, the man page for 'file' says:

-h, --no-dereference

    option causes symlinks not to be followed (on systems  that  support  symbolic
    links). This is the default if the environment variable POSIXLY_CORRECT is not
    defined.

and also:

-L, --dereference

    option  causes  symlinks to be followed, as the like-named option in ls(1)
    (on systems that support symbolic links).  This is the default if the 
    environment variable POSIXLY_CORRECT is defined.

For me, the default seems to be the "-L" behavior (i.e., always traversing symlinks and reporting the type of the target file), regardless of whether I have POSIXLY_CORRECT set or not.

The "-h" option does the right thing if I explicitly specify it, fortunately.

Can anyone still running 10.5.8 (yeah, I know...) verify whether this is the behavior for them as well? And if it does work for you as advertised by the man page, any theories on what I'm doing wrong? I've checked my spelling, just to get that out of the way...

share|improve this question

1 Answer 1

up vote 1 down vote accepted

On my copy of Mac OS X 10.5.8, I see the same behaviour as you. file somelink and file -L somelink have the same, --dereference behaviour, regardless of the presence or absence of an environment variable POSIXLY_CORRECT. file -h somelink has the --no-dereference behaviour.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.