Created
August 5, 2013 14:44
-
-
Save yteraoka/6156440 to your computer and use it in GitHub Desktop.
標準入力から Bash script を実行する場合に引数を渡す方法 ref: http://qiita.com/yteraoka/items/b592dc147f233564dc24
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
$ echo 'echo $1; echo $2' | bash hoge fuga | |
bash: hoge: No such file or directory |
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
$ echo 'echo $1; echo $2' | bash - hoge fuga | |
bash: hoge: No such file or directory |
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
$ echo 'echo $1; echo $2' | bash /dev/stdin hoge fuga | |
hoge | |
fuga |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment