I want to pass a string as command line argument to a bash script; Simply my bash script is:
>cat test_script.sh
for i in $*
do
echo $i
done
I typed
bash test_script.sh test1 test2 "test3 test4"
Output :
test1
test2
test3
test4
Output I am expecting:
test1
test2
test3 test4
I tried with backslashes (test1 test2 "test3\ test4") and single quotes but I haven't got the expected result.
How do I get the expected output?