Keep a station name together
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 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.
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.
Track the values line by line. Predict the result before running this example in your own editor.