I created a bash shell script to zip all files that match a pattern as follows:
zip $1 $2
When I run the above script using
./myScript.sh myzip test*, only one file that starts with the name test is added to the zip even though my directory has 2 files (test1 and test2) that match the pattern.
If I run the
zip command directly from the shell, it works as expected and adds both test1 and test2 to myzip. But when I use a script to do this, it adds only 1 file.
What am I missing?