Created
April 13, 2012 01:03
-
-
Save usagi/2372494 to your computer and use it in GitHub Desktop.
/bin/shの任意番目(例えば$argc=2)の引数へさくっとアクセスするテスト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
argc=2 | |
echo '/bin/shの任意番目(例えば$argc=2)の引数へさくっとアクセスするテスト' | |
eval echo \$$argc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LH-MAIN /tmp% cat sh_argv_argc_sample.sh
/bin/sh
argc=2
echo '/bin/shの任意番目(例えば$argc=2)の引数へさくっとアクセスするテスト'
eval echo $$argc
LH-MAIN /tmp% ./sh_argv_argc_sample.sh aaa bbb ccc
/bin/shの任意番目(例えば$argc=2)の引数へさくっとアクセスするテスト
bbb