Color theme
0 day streak0 XPP1
BashQuiz mode
MISSION 1 OF 3

Keep a station name together

0 XP earned
Bash track: IntermediateMission: BeginnerShell quotingPositional parametersWord splitting
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 / 6 challenges
KNOWLEDGE CHECK

Predict the result.

What two lines does the station script print?

quest.sh
station="North Quay"set -- "$station"printf 'Stop: <%s>\n' "$1"printf 'Arguments: %s\n' "$#"

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.

Review the lesson

A station name contains a space, but it should remain one argument. Double quotes allow variable expansion while preventing word splitting and filename expansion. set -- replaces the script's positional arguments. $1 reads the first argument, and $# reports how many arguments the quoted assignment created.

Choose your answer+25 XP on first completion