Ive been having trouble getting my bash script to accept wildcards when there are multiple arguments, and am just trying to use this with an ls as described below:
Say I have these 4 files in the directory
I essentially have a script like this called test_script
ls $arg1 > chk1.txt
ls $arg2 > chk2.txt
I can get the results I want to obtain by running the script as:
test_script "*abc*" "*xyz*"
However I need others to use this scripts and normally we dont need to quote things in order to get the wildcards to work
I have tried using $@ (although I really dont know what this does), but can only seem to get that to work properly if there is only one argument given.