Skip to content

Instantly share code, notes, and snippets.

@yteraoka
Created August 5, 2013 14:44
Show Gist options
  • Save yteraoka/6156440 to your computer and use it in GitHub Desktop.
Save yteraoka/6156440 to your computer and use it in GitHub Desktop.
標準入力から Bash script を実行する場合に引数を渡す方法 ref: http://qiita.com/yteraoka/items/b592dc147f233564dc24
$ echo 'echo $1; echo $2' | bash hoge fuga
bash: hoge: No such file or directory
$ echo 'echo $1; echo $2' | bash - hoge fuga
bash: hoge: No such file or directory
$ 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