On Sat, Apr 29, 2017 at 07:47:06PM -0400, Adam Danischewski wrote:
> $ [[ -L
> "/mnt/samsung32/.word_list_repo/instruments_song_repo/546725_pinstripe.mp3"
> ]] && echo hi
> hi

> $ [[ -f
> "/mnt/samsung32/.word_list_repo/instruments_song_repo/546725_pinstripe.mp3"
> ]] && echo hi
> hi
> 
> It looks like the test operator "-f" is not functioning as described,
> according to the documentation this should only return true on a REGULAR
> file, not a symbolic link.

It returns true for a symbolic link TO a regular file, as documented.

man bash -> CONDITIONAL EXPRESSIONS

      Conditional expressions are used by the [[ compound  command  and  the
      test and [ builtin commands to test file attributes and perform string
      and arithmetic comparisons.
    [...]
      Unless otherwise specified, primaries that  operate  on  files  follow
      symbolic  links and operate on the target of the link, rather than the
      link itself.

Reply via email to