Skip to content

Instantly share code, notes, and snippets.

@rafaelmaeuer
Created July 16, 2023 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelmaeuer/2ca3613338f39e28442fed8e047874bb to your computer and use it in GitHub Desktop.
Save rafaelmaeuer/2ca3613338f39e28442fed8e047874bb to your computer and use it in GitHub Desktop.
wrappedProgram "$@"
# ^^^ this is correct and will hand over all arguments in the way
# we received them, i. e. as several arguments, each of them
# containing all the spaces and other uglinesses they have.
wrappedProgram "$*"
# ^^^ this will hand over exactly one argument, containing all
# original arguments, separated by single spaces.
wrappedProgram $*
# ^^^ this will join all arguments by single spaces as well and
# will then split the string as the shell does on the command
# line, thus it will split an argument containing spaces into
# several arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment