unable to get the complete list of file matching the regular expression in shell script -
i have directory list of files abc_1.txt abc_2.txt
. have parse file name , processing on file
#shellscript /tmp/log* file_list=`ls $1` file_name in $file_list # need processing on file name echo $file_name done
the script not giving proper output i.e script not giving matching wildcard file name ls
cmd. usage of above script shellscript /tmp/log*
bash expands shellscript /tmp/log/abc*
list of files names input script. ls
not needed. iterate on input. try this
for f in $* echo "processing $f" # on $f done
http://www.cyberciti.biz/faq/bash-loop-over-file/ gives more examples.
Comments
Post a Comment