POSIX Shell Command Language

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

POSIX-2017

Shell & Utilities

Shell Command Language

FC LFLAGS OPTARG TMPDIR


1. Shell Introduction
FCEDIT LINENO OPTERR TZ
2. Quoting FFLAGS LINES OPTIND USER
| & ; < > ( ) $ ` \ " ' <space> <tab> <newline> GET LISTER PAGER VISUAL
* ? [ # ˜ = %
1. Escape Character (Backslash) GFLAGS LOGNAME PATH YACC
2. Single-Quotes HISTFILE LPDEST PPID YFLAGS
3. Double-Quotes
HISTORY MAIL PRINTER
3. Token Recognition HISTSIZE MAILCHECK PROCLANG
1. Alias Substitution HOME MAILER PROJECTDIR
4. Reserved Words
6. Word Expansions
! do esac in 1. Tilde Expansion
{ done fi then 2. Parameter Expansion
} elif for until ${parameter}
case else if while ${parameter:-[word]}
${parameter:=[word]}
5. Parameters and Variables ${parameter:?[word]}
1. Positional Parameters ${parameter:+[word]}
2. Special Parameters ${#parameter}
3. Shell Variables ${parameter%[word]}
${parameter%%[word]}
XBD Environment Variables ${parameter#[word]}
${parameter##[word]}
ARFLAGS IFS MAILPATH PS1 3. Command Substitution
$(command)
CC LANG MAILRC PS2 4. Arithmetic Expansion
CDPATH LC_ALL MAKEFLAGS PS3 $((expression))
5. Field Splitting
CFLAGS LC_COLLATE MAKESHELL PS4 6. Pathname Expansion
CHARSET LC_CTYPE MANPATH PWD 7. Quote Removal
COLUMNS LC_MESSAGES MBOX RANDOM
7. Redirection
DATEMSK LC_MONETARY MORE SECONDS [n]redir-op word
DEAD LC_NUMERIC MSGVERB SHELL 1. Redirecting Input
2. Redirecting Output
EDITOR LC_TIME NLSPATH TERM 3. Appending Redirected Output
ENV LDFLAGS NPROC TERMCAP 4. Here-Document
EXINIT LEX OLDPWD TERMINFO 5. Duplicating an Input File Descriptor
6. Duplicating an Output File Descriptor until compound-list-1
7. Open File Descriptors for Reading and Writing do
compound-list-2
8. Exit Status and Errors done
1. Consequences of Shell Errors
2. Exit Status for Commands 5. Function Definition Command
fname ( ) compound-command [io-redirect ...]
9. Shell Commands
1. Simple Commands 10. Shell Grammar
2. Pipelines 1. Shell Grammar Lexical Conventions
[!] command1 [ | command2 ...] 2. Shell Grammar Rules
3. Lists 11. Signals and Error Handling
command1 & [command2 & ... ]
command1 [; command2] ... 12. Shell Execution Environment
command1 [ && command2] ...
command1 [ || command2] ... 13. Pattern Matching Notation
1. Patterns Matching a Single Character
4. Compound Commands 2. Patterns Matching Multiple Characters
( compound-list ) 3. Patterns Used for Filename Expansion
{ compound-list ; }
14. Special Built-In Utilities
for name [ in [word ... ]] • break - exit from for, while, or until loop
do • colon - null utility
compound-list • continue - continue for, while, or until loop
done • dot - execute commands in the current environment
• eval - construct command by concatenating arguments
case word in
[(] pattern1 ) compound-list ;; • exec - execute commands and open, close, or copy file
[[(] pattern[ | pattern] ... ) compound-list ;;] descriptors
[[(] pattern[ | pattern] ... ) compound-list] • exit - cause the shell to exit
esac • export - set the export attribute for variables
• readonly - set the readonly attribute for variables
• return - return from a function or dot script
if compound-list • set - set or unset options and positional parameters
then • shift - shift positional parameters
compound-list
[elif compound-list • times - write process times
then • trap - trap signals
compound-list] ... • unset - unset values and attributes of variables and
[else functions
compound-list]
fi

while compound-list-1
do
compound-list-2
done

You might also like