Intel XENIX 286 Programmers Guide (86) - Tenox.tc
Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc
XENIX Programming switch ( string case string 1: commands breaksw case stringn: commands breaksw default: commands breaksw endsw csh: C Shell For details see csh in Appendix B. C programmers should note that breaksw is used to exit from a switch while break exits from a while or foreach loop. A common mistake to make in C shell scripts is to use break rather than breaksw in switches. Finally, the C shell supports a goto statement, with labels looking like they do in C, e.g.: loop: commands goto loop Supplying Input to Commands Commands run from C shell scripts receive by default the standard input of the C shell running the script. This feature enables C shell scripts to fully participate in pipelines but mandates extra notation for commands that take inline data. Thus we need a metanotation for supplying inline data to commands in C shell scripts. For example, consider this script that runs the editor to delete leading blanks from the lines in each argument file: # deblank -- rem ove leading blanks foreach i ($argv) ed - $i
csh: C Shell XENIX Programming The notation < < ' EOF' means that the standard input for the ed command is to come from the text in the C shell script file up to the next line consisting of exactly EOF. Because EOF is quoted in single quotation marks ('), the C shell does not perform variable substitution on the intervening lines. In general, if any part of the word following the 11
- Page 122 and 123: XENIX Programming adb: Program Debu
- Page 124 and 125: XENIX Programming adb: Program Debu
- Page 126 and 127: XENIX Programming adb: Program Debu
- Page 128: XENIX Programming adb: Program Debu
- Page 131 and 132: as: A sse m bier XENIX Programming
- Page 133 and 134: as: Assembler XENIX Programming The
- Page 135 and 136: as: Assembler XENIX Programming Key
- Page 137 and 138: as: Assembler The combination rules
- Page 139 and 140: as: Assembler XENIX Programming Ins
- Page 141 and 142: as: Assembler Initial Value Directi
- Page 143 and 144: as: Assembler XENIX Programming int
- Page 145 and 146: as: A sse m bier sub subb test test
- Page 147 and 148: as: Assembler XENIX Programming lnt
- Page 149 and 150: as: Assembler XENIX Programming lnt
- Page 151 and 152: as: Assembler XENIX Programming Imm
- Page 153 and 154: as: A sse m bier XENIX Programming
- Page 156 and 157: CHAPTER 8 csh : C SHEll The C shell
- Page 158 and 159: XENIX Programming csh: C Shell Some
- Page 160 and 161: XENIX Programm ing *w 32 * q % !c -
- Page 162 and 163: XENIX Programming csh: C Shell the
- Page 164 and 165: XENIX Programming csh: C Shell Usin
- Page 166 and 167: XENIX Programming csh: C Shell Usin
- Page 168 and 169: XENIX Programming csh: C Shell The
- Page 170 and 171: XENIX Programming csh: C Shell Note
- Page 174 and 175: XENIX Programming csh: C Shell Star
- Page 176 and 177: XENIX Programming csh: C Shell Spec
- Page 178 and 179: CHAPTER 9 lex : LEXICAL ANA LYZER G
- Page 180 and 181: XENIX Programming lex: Lexical Anal
- Page 182 and 183: XENIX Programming lex: Lexical Anal
- Page 184 and 185: XENIX Programming lex: Lexical Anal
- Page 186 and 187: XENIX Programming lex: Lexical Anal
- Page 188 and 189: XENIX Programming lex: Lexical Anal
- Page 190 and 191: XENIX Programming lex: Lexical Anal
- Page 192 and 193: XENIX Programm ing lex: Lexical Ana
- Page 194 and 195: XENIX Programming Specifying Source
- Page 196 and 197: XENIX Programming lex: Lexical Anal
- Page 198 and 199: XENIX Programming lex: Lexical Anal
- Page 200 and 201: XENIX Programming The definitions s
- Page 202 and 203: CHAPTER 10 yacc: COMPILER-COMPILER
- Page 204 and 205: XENIX Programming yacc: Compiler-Co
- Page 206 and 207: XENIX Programming yacc: Compiler-Co
- Page 208 and 209: XENIX Programming yacc: Compiler-Co
- Page 210 and 211: XENIX Programming yacc: Compiler-Co
- Page 212 and 213: XENIX Programming yacc: Compiler-Co
- Page 214 and 215: XENIX Programming yacc: Compiler-Co
- Page 216 and 217: XENIX Programming yacc: Compiler-Co
- Page 218 and 219: XENIX Programming yacc: Compiler-Co
- Page 220 and 221: XENIX Programming yacc: Compiler-Co
<strong>XENIX</strong> Programming<br />
swi<strong>tc</strong>h ( string<br />
case string 1:<br />
commands<br />
breaksw<br />
case stringn:<br />
commands<br />
breaksw<br />
default:<br />
commands<br />
breaksw<br />
endsw<br />
csh: C Shell<br />
For details see csh in Appendix B. C programmers should note that breaksw is used to<br />
exit from a swi<strong>tc</strong>h while break exits from a while or foreach loop. A common mistake<br />
to make in C shell scripts is to use break rather than breaksw in swi<strong>tc</strong>hes.<br />
Finally, the C shell supports a goto statement, with labels looking like they do in C, e.g.:<br />
loop:<br />
commands<br />
goto loop<br />
Supplying Input to Commands<br />
Commands run from C shell scripts receive by default the standard input of the C shell<br />
running the script. This feature enables C shell scripts to fully participate in pipelines<br />
but mandates extra notation for commands that take inline data.<br />
Thus we need a metanotation for supplying inline data to commands in C shell scripts.<br />
For example, consider this script that runs the editor to delete leading blanks from the<br />
lines in each argument file:<br />
# deblank -- rem ove leading blanks<br />
foreach i ($argv)<br />
ed - $i