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/samsung32/.word_list_repo/instruments_song_repo/546725_pinstripe.mp3"
]] && echo hi
hi
$ [[ ! -L
"/mnt/samsung32/.word_list_repo/instruments_song_repo/546725_pinstripe.mp3"
]] && echo 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.

You can repeat the behavior by creating any symbolic link to a file or
directory and then using the test operator on the command line.

cd /tmp
touch test.txt
ln -s test.txt lnk2test
[[ -f lnk2test ]] && echo hi
[[ -L lnk2test ]] && echo hi
[[ ! -L lnk2test ]] && echo hi

The first test above -f should fail yet doesn't, the last negated symbolic
link test may be a workaround for finding a regular file unless you see
something wrong with that.


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



Re: globstar question

2017-04-29 Thread L A Walsh



Chet Ramey wrote:

On 4/28/17 8:09 PM, L A Walsh wrote:

ls **Tokyo*
(nothing)
ls ***Tokyo*
(nothing)
ls **Tokyo**Tokyo*
(nothing)
ls **/*Tokyo*
(found multiple matches (including the one I was
searching for))



Because the first two search for files containing the string `Tokyo' in the
current directory and the third finds files containing `Tokyo' twice.
  


   So '**' is only special when it's a token by itself?