Mission 347

Quoted argument review

Preserve a multi-word value while capturing predictable output.

Shell scripting
8 minutes Admin Lesson 347 of 360
printfteecat
Lesson 347 of 360 0/360 lessons 0/17 missions Shell scripting · 8 minutes
0%
Continue View profile
Ops lab terminal Training lab
New learnerrank 0XP 0%complete
learner@clairos:/home/learner $ Unix ops lab: type a command, press Enter
Instructions 8 minutes

Click any instruction for the command details, the why, and the common mistake to avoid.

Capture a quoted label

Run printf "release candidate" | tee lab/release-label.txt.

printf "release candidate" | tee lab/release-label.txt
Read the captured label

Run cat lab/release-label.txt.

cat lab/release-label.txt
Count the output lines

Run wc -l lab/release-label.txt.

wc -l lab/release-label.txt
Lesson support

What to notice while you play.

Objective

Build repeatable confidence with keeping one logical value inside one quoted argument.

Hint

Start with printf "release candidate" | tee lab/release-label.txt, inspect the result, then continue in order.

Why it matters

Keeping one logical value inside one quoted argument helps operators explain what they know before they change anything.

Common mistakes
  • Skipping the output that proves keeping one logical value inside one quoted argument.
  • Changing several things before recording a baseline.
Reference

Commands in this lesson.

printf <text>

Print formatted training text.

cat <file>

Print text file contents.

tee <file>

Write piped text to a lab file and keep it on screen.