osx - Bash glob pattern behaviour different between terminal and shell script -
i have glob pattern {,**/}*.* recursing through files in current directory plus children. in terminal if run echo {,**/}*.* outputs of files in current directory plus nested directories. when run shell script contains line 1 directory deep.
i understand terminal has different behaviour shell: adding shopt -s extglob made no difference.
#!/bin/bash shopt -s extglob echo {,**/}*.* i on macosx bash 4 terminal , shopt -s globstar enabled.
thanks @aserre , @anubhava, indeed combination of bash path , making sure globstar enabled (for macosx). full script is:
#!/usr/local/bin/bash shopt -s globstar echo {,**/}*.* and yes ./** suffice wasn't problem :)
Comments
Post a Comment