bash가 argument를 해석하지 않게하려면?

badboy의 이미지

shell# ls S*
S1.dat S2.dat

shell# cat test.sh
#!/bin/bash
if [ $# = 1 ]; then
echo "Argc is 1" $1
fi
for i in ${*}; do
echo $i
done

shell# ./test.sh S*
S1.dat
S2.dat

shell# ./test.sh "S*"
Argc is 1 S1.dat S2.dat
S1.dat
S2.dat

두번의 실행중 아래의 경우에 "S*"라는 결과를 얻고 싶습니다.

어찌해야하나요?

aero의 이미지

$ cat ./test.sh
#!/bin/bash
if [ $# = 1 ]; then
echo "Argc is 1" "$1"
exit
fi
for i in ${*}; do
echo $i
done

$ ./test.sh S*
S1.dat
S2.dat

$ ./test.sh "S*"
Argc is 1 S*