Color theme
0 day streak0 XPP1
BashLearn mode
MISSION 1 OF 1

Pass a cast list

0 XP earned
Bash track: IntermediateMission: IntermediateArgument forwardingShell functionsEmpty arguments
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.

x
0 / 2 challenges
LEARN THE CONCEPT

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.

quest.sh
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.