Check a podcast caption
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 podcast preview should announce whether a caption contains text. Inside Bash's [[ ]] conditional command, -n tests whether a string has nonzero length. An empty string fails that test, so execution follows else. This checks the value itself and does not read a file or require an external command.
caption=""if [[ -n "$caption" ]]; then printf '%s\n' "Caption available"else printf '%s\n' "Caption missing"fiRun 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.