Created
January 14, 2015 15:49
-
-
Save decklin/8b255647836df89f8612 to your computer and use it in GitHub Desktop.
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
$ set -- one 'foo bar' three | |
$ ruby -e 'puts ARGV.count, ARGV.last' "$@ extra" | |
3 | |
three extra | |
$ args="$@ extra" | |
$ ruby -e 'puts ARGV.count, ARGV.last' "$args" | |
1 | |
one foo bar three extra | |
$ ruby -e 'puts ARGV.count, ARGV.last' $args | |
5 | |
extra | |
$ argsarr=("$@") | |
$ ruby -e 'puts ARGV.count, ARGV.last' "${argsarr[@]} extra" | |
3 | |
three extra |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment