Shell, is the “Sleeping Beauty” of Linux. Consider a command named echo that works like ECHO in DOS, its main function being to display its arguments ( the character string you supply to it ) on the screen. Unlike banner, the characters have the same size as the characters in the command itself : –

"

$ echo Hello World

Hello World

So far, so good, simple enough right ? Now what happens when we provide a lot of spaces between the words “Hello” and “World” ? try it and see : –

"

$ echo Hello World

Hello World

The multiple Spaces here reduce to a single space. This compression isn’t done by the echo command but by someone who “watches” everything we do. This watchdog looks for some special characters, many of which should seem quite ordinary to you. The space seems to be a special one, and the action taken by the watchdog, when it finds them, is to squeeze them to a single one. We now encounter a situation where someone has tampered with our input.

This lands us in a dual situation. We may sometimes want to preserve these spaces, and we should be able to tell the watchdog to refrain from doing its normal duty. The enclosing echo’s arguments within quotes : –

"

$ echo "Hello World"

Hello                    World

This protective mechanism works, and the watchdog is unable to effect any compression this time. Nope, that unlike in DOS, the quotes themselves have not been echoed (displayed) on the screen.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!