Pass a cast list
Before you start this intermediate track
Terminal basics and command arguments. Quoting and expansion change how a command behaves.
Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.
Understand it, then try it.
A stage announcer function prints each cast entry in angle brackets. Quoted "$@" expands to one argument per positional parameter, preserving spaces and empty entries. Bash functions receive their own positional parameters from the call. printf repeats its format for the remaining arguments, revealing whether the cast list arrived intact.
announce() { printf '<%s>\n' "$@"}set -- "Jo Lee" "Max" ""announce "$@"Run each mission independently with bash quest.sh in Bash 5 or later, using the default IFS value. Every command is a Bash builtin; the scripts create no files, contact no services, and need no command-line arguments.
Track the values line by line. Predict the result before running this example in your own editor.