하기와 같이 실행하였는데, 에러가 발생하고 있습니다.
간단한 쉘 같은데, 에러가 발생하는 이유가 파악이 안되고 있습니다.
DEBIAN 및 Mac OS X에서도 동일한 현상이 발생합니다.
아시는 분의 고견 부탁 드려 봅니다.
#> wget http://216.165.129.135/distfiles/prettyping-1.0.1.tar.gz
#> tar xzvf prettyping-1.0.1.tar.gz
#> cd prettyping-1.0.1
#> chmod +x prettyping
#> ./prettyping
./prettyping: line 162: syntax error near unexpected token `"$1"'
./prettyping: line 162: ` PING_PARAMS+=("$1")'
#> vi prettyping
...
#TODO: Check if these parameters are numbers.
-last | --last ) LAST_N="$2" ; shift ;;
-columns | --columns ) OVERRIDE_COLUMNS="$2" ; shift ;;
-lines | --lines ) OVERRIDE_LINES="$2" ; shift ;;
-rttmin | --rttmin ) RTT_MIN="$2" ; shift ;;
-rttmax | --rttmax ) RTT_MAX="$2" ; shift ;;
* )
PING_PARAMS+=("$1") <======================== !!!
;;
esac
shift
κ ɼ ־ ٽó־ ΰ ?
exit ٲٰ ɼ ־ Ǹ ƴѰ ?
#> ./prettyping 1.1.1.1
./prettyping 1.1.1.1
./prettyping: line 162: syntax error near unexpected token `"$1"'
./prettyping: line 162: ` PING_PARAMS+=("$1")'
ū ǹ̰ ѵ ù° #!/usr/bin/env bash => #!/usr/bin/bash bash غ
/usr/bin/bash --version Ȯ
ش ǹ̴ - Ȥ -- ɼ ָ ش ɼü $1 ĶͰ ǰ
$2 ش ɼǿ ǹϴ ǥϽ
PING_PARAMS+=("$1") κ ̷ ɼ ̰ ٷ ping option ˴ϴ.
- Ȥ -- ɼ ھ shift v Ķ ϳ ˴ϴ.
./prettyping -last 10 192.168.0.11 ̷ ߴٰ ϸ ϴ.
case -last | --last ɼǿ ̰ $1 Īǰ ڿ $2 ˴ϴ.
ϳ shift ؼ ű case (esac) ϳ shift Ѽ
ᱹ ip PING_PARAMS 迭 ߰˴ϴ.
Ķ ĽҶ while ϴ.
command parameter parsing Ϲ Դϴ.
ping OS option ݾ ٸϴ.