Discussion
Which is the correct way of handling arguments with spaces?
Answer: B
Correct answer: Either single or double quotes
The shell splits the command line on whitespace, so an argument containing a space must be quoted to arrive intact. Both quoting styles achieve that.
They differ in what else they do: double quotes still allow the shell to expand variables and command substitutions inside them, while single quotes suppress everything and pass the text literally. For an argument containing only spaces either works; where the text also contains $ or a backtick, single quotes are the safer choice.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development