I have a glob pattern {,**/}*.* for recursing through all files in current directory plus children. In the terminal if I run echo {,**/}*.* it outputs all of the files in the current directory plus the nested directories. When I run a shell script which contains this line it only does one directory deep.
I understand that terminal has different behaviour than the shell: adding shopt -s extglob made no difference.
#!/bin/bash
shopt -s extglob
echo {,**/}*.*
I am on MacOSX with Bash 4 terminal and shopt -s globstar enabled.
Thanks @Aserre and @anubhava, it was indeed the combination of bash path and making sure globstar was enabled (for MacOSX). Full script is:
And yes
./**would suffice but that wasn't my problem :)