Shell Parse Order: Breaking the rules

Rules are meant to be broken, hence the Shell parsing order.

There might need arises to skip some of the steps in shell parsing order mentioned in my previous post and we use Quotes ( single & double quotes ) or ‘eval’ command to skip or redo the steps in the parsing order.

Double quotes (“):

Double quotes would run through steps 1, 6, 7, 8 from the parsing order before execution. ie.

1. Tokenize

6. Parameter Substitution

7. Command Substitution

8. Arithmetic Expression

Single Quotes:

Single quotes (‘) would simply skip through all the steps after Tokenize and execute the command.

eval:

While quotes have been used to skip through, the ‘eval’ command has been used to redo the entire sequence of shell parsing once again. ie. The output from the step 11 would be fed to the step 1 and the entire parsing would happen once again.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: