[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: How to handle passing filenames with spaces and wildcards int o bash scripts?



Thanks in advance for any hints/help/pointers/tricks that you can provide. 
/Mike

Try using $@ in place of $*

For example, consider the script:
echo $#
echo $@

for i in "$@"
do
echo $i
done

######################

say the script was called /tmp/zzzz

run /tmp/zzzz  test1  test2 "test3 test4"
$# should be 3
and the output should be
test1
test2
test3 test4

Hope this helps


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]