Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
Created April 6, 2022 17:14
Show Gist options
  • Save JoshCheek/36b5a5e584e1fea724af73de44a1e527 to your computer and use it in GitHub Desktop.
Save JoshCheek/36b5a5e584e1fea724af73de44a1e527 to your computer and use it in GitHub Desktop.
How to forward args in Bash (`"$@"`)
set -- a 'b c' d
ruby -e 'puts %($*), ARGV.map { " #{_1.inspect}" }, ""' $*
ruby -e 'puts %("$*"), ARGV.map { " #{_1.inspect}" }, ""' "$*"
ruby -e 'puts %($@), ARGV.map { " #{_1.inspect}" }, ""' $@
ruby -e 'puts %("$@"), ARGV.map { " #{_1.inspect}" }, ""' "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment