I have a simple bash script file named: test.sh.
#!/bin/bash
ls $1;
I gave the execution permissions:
$ ./test.sh "**/*.java"
shows only one file
where as
$ ls **/*.java
shows hundreds of files
So how to make the script work.
To enable support for ** in Bash, use the globstar option:
#!/bin/bash
shopt -s globstar
ls $1
(See §4.3.2 "The Shopt Builtin" in the Bash Reference Manual.)