xref: /original-bsd/bin/sh/USD.doc/t4 (revision 93152bbe)
%sccs.include.proprietary.roff%

@(#)t4 6.2 (Berkeley) 04/17/91

.bp
Appendix A - Grammar

item: word input-output name = value simple-command: item simple-command item command: simple-command ( command-list ) { command-list } for name do command-list done for name in word \*(ZZ do command-list done while command-list do command-list done until command-list do command-list done case word in case-part \*(ZZ esac if command-list then command-list else-part fi pipeline: command pipeline \*(VT command andor: pipeline andor && pipeline andor \*(VT\*(VT pipeline command-list: andor command-list ; command-list & command-list ; andor command-list & andor input-output: > file < file \*(AP word \*(HE word file: word & digit & - case-part: pattern ) command-list ;; pattern: word pattern \*(VT word else-part: elif command-list then command-list else-part else command-list empty empty: word: a sequence of non-blank characters name: a sequence of letters, digits or underscores starting with a letter digit: 0 1 2 3 4 5 6 7 8 9

.bp

Appendix B - Meta-characters and Reserved Words

a) syntactic

\*(VT 6
pipe symbol
&& 6
`andf' symbol
\*(VT\*(VT 6
`orf' symbol
; 6
command separator
;; 6
case delimiter
& 6
background commands
( ) 6
command grouping
< 6
input redirection
\*(HE 6
input from a here document
> 6
output creation
\*(AP 6
output append

b) patterns

\*(ST 6
match any character(s) including none
? 6
match any single character
[...] 6
match any of the enclosed characters

c) substitution

${...} 6
substitute shell variable
\`...\` 6
substitute command output

d) quoting

\e 6
quote the next character
\'...\' 6
quote the enclosed characters except for \'
"..." 6
quote the enclosed characters except for $ \` \e "

e) reserved words if then else elif fi case in esac for while until do done { }