24.12.2012 Views

CSC322 C Programming and UNIX - Department of Computer ...

CSC322 C Programming and UNIX - Department of Computer ...

CSC322 C Programming and UNIX - Department of Computer ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Comm<strong>and</strong> Format<br />

Normal <strong>UNIX</strong> comm<strong>and</strong> format: . . . <br />

– The first word is interpreted as a comm<strong>and</strong><br />

– The remaining words (separated by spaces or blanks) are arguments<br />

– The implementation <strong>of</strong> a comm<strong>and</strong> is free in how it treats the arguments<br />

– Convention: Arguments starting with a dash - are options<br />

Many characters have special meaning in most shells, including $, (, ), [,<br />

], *, &, |, ;, \, , ’, ", ’ ’ (blank, the argument separator)<br />

– Arguments may be enclosed in single quotes (’ ’) or in double quotes (" ")<br />

to suppress most special meanings<br />

∗ Single quotes suppress (nearly) all special meanings<br />

∗ Double quotes suppress most special meanings<br />

∗ In particular, both suppress the meaning <strong>of</strong> blank: A string ’a a’ will appear<br />

as a single argument to a comm<strong>and</strong><br />

∗ Quotes are not passed on to the comm<strong>and</strong>!<br />

– The backslash \ can be used to suppress the special meaning <strong>of</strong> individual<br />

characters. \” represents a double quote, \\ a backslash character<br />

Stephan Schulz 40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!