Re: Bash -f Test Operator - Not working as expected

2017-05-02 Thread Chet Ramey
On 5/2/17 9:07 AM, Eduardo Bustamante wrote: > On Tue, May 2, 2017 at 7:13 AM, Greg Wooledge wrote: > [...] >> would be safe. Your test command has 6 arguments, for which "the results >> are unspecified". >> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html > > Hm. That section

Re: Bash -f Test Operator - Not working as expected

2017-05-02 Thread Eduardo Bustamante
On Tue, May 2, 2017 at 7:13 AM, Greg Wooledge wrote: [...] > would be safe. Your test command has 6 arguments, for which "the results > are unspecified". > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html Hm. That section of the standard refers to "The algorithm for determinin

Re: Bash -f Test Operator - Not working as expected

2017-05-02 Thread Greg Wooledge
On Mon, May 01, 2017 at 11:24:44PM -0500, Eduardo Bustamante wrote: > > For the behavior you want, you need something like: > > > > test ! -h "$pathname" -a -f "$pathname" Don't use that. test ! -h "$pathname" && test -f "$pathname" would be safe. Your test command has 6 arguments, for which

Re: Bash -f Test Operator - Not working as expected

2017-05-01 Thread Eduardo Bustamante
On Mon, May 1, 2017 at 8:52 PM, Eduardo Bustamante wrote: > On Sat, Apr 29, 2017 at 8:56 PM, Adam Danischewski > wrote: >> In the documentation you linked to it says: >> >> -f file >> True if file exists and is a regular file. >> >> The part of the documentation you cited states "Unless otherwise

Re: Bash -f Test Operator - Not working as expected

2017-05-01 Thread Greg Wooledge
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

Re: Bash -f Test Operator - Not working as expected

2017-04-29 Thread Eduardo Bustamante
This is not a bug, and it has come up before. Please read: https://lists.gnu.org/archive/html/bug-bash/2013-06/msg00110.html and https://lists.gnu.org/archive/html/bug-bash/2015-02/msg00029.html

Bash -f Test Operator - Not working as expected

2017-04-29 Thread Adam Danischewski
$ ls -al /mnt/samsung32/.word_list_repo/instruments_song_repo/546725_pinstripe.mp3 lrwxrwxrwx 1 cronkilla cronkilla 74 Apr 29 19:30 /mnt/samsung32/.word_list_repo/instruments_song_repo/546725_pinstripe.mp3 -> /mnt/samsung32/.word_list_repo/master_song_repo/0/4/5/546725_pinstripe.mp3 $ [[ -L "/mnt/s