Linux - Explain the steps that a shell follows while processing a command

Explain the steps that a shell follows while processing a command.

The sequence of executing commands by shell are as follows:

Parsing: The command is broke into words, by using the spaces as delimiters unless quoted. The tabs are replaced by a single space.

Evaluation of a variable: The words with $ as preceding character will be evaluted unless quoted.

Command Substitution: The commands surrounded by backquotes will be executed by the shell. Later these will be replaced into standard output of the command into command line.

Wild card interpretation: Finally, the shell identifies all the wild cards(?,*) in the command line and replaces the wild card with sorted list of file names which maches the pattern.

PATH evaluation: Ultimately shell looks for the PATH variable for the purpose of determining the sequence of directories to search for the files or commands.
Linux - Difference between cmp and diff commands
Difference between cmp and diff commands - Byte by byte comparision performed for two files comparision and displays the first mismatch byte.........
Linux - What is the use of ‘grep’ command? Provide an example
What is the use of ‘grep’ command? - Grep stands for regular expression. ‘grep’ command is used to find the patterns in a text file provided by the user.......
Linux - Difference between cat and more command
Difference between cat and more command - The file contents are displayed by ‘cat’ command.........
Post your comment