Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Debian GNU/Linux Reference Guide
Prev Home Next

13.2.6 Command-line processing

The shell processes a script as follows:

  • split into tokens by the metacharacters: SPACE, TAB, NEWLINE, ;, (, ), <, >, |, &

  • check keyword if not within "..." or '...' (loop)

  • expand alias if not within "..." or '...' (loop)

  • expand brace, a{1,2} -> a1 a2, if not within "..." or '...'

  • expand tilde, ~user -> user's home directory, if not within "..." or '...'

  • expand parameter, $PARAMETER, if not within '...'

  • expand command substitution, $(command), if not within '...'

  • split into words with $IFS if not within "..." or '...'

  • expand *?[] in pathname if not within "..." or '...'

  • look up command

    • function

    • built-in

    • file in $PATH

  • loop

Single quotes within double quotes have no effect.

Executing set -x in the shell or invoking the shell with -x option make the shell to print all of commands executed. This is quite handy for debugging.


Debian GNU/Linux Reference Guide
Prev Home Next

 
 
  Published under the terms of the GNU General Public License Design by Interspire