How do I pass a wildcard parameter to a bash file
The parent shell, the one invoking bash show_files.sh *, expands the * for you. In your script, you need to use: for dir in “$@” do echo “$dir” done The double quotes ensure that multiple spaces etc in file names are handled correctly. See also How to iterate over arguments in a bash shell script. … Read more