🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Bash Scripting for DevOps: all 10 questions

Quiz: Bash Scripting for DevOps · Question 4 of 10

A variable file holds exam marks.txt. Why is rm "$file" safer than rm $file?

A variable file holds exam marks.txt. Why is rm "$file" safer than rm $file?

  1. A.Quotes make rm faster
  2. B.Without quotes bash cannot read variables
  3. C.Without quotes bash splits the value at the space and treats it as two file names
  4. D.Quotes ask for confirmation before deleting
Answer & explanation

Correct answer: Without quotes bash splits the value at the space and treats it as two file names

Unquoted values are split into words, so the command acts on exam and marks.txt instead of one file.

Can you get the rest right without peeking?

Take the timed Quiz: Bash Scripting for DevOps quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →