16.05.2015 Views

Working with the Unix OS

Working with the Unix OS

Working with the Unix OS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Unix</strong> Tools<br />

Brown eqn 1 # output<br />

Jones spell 5<br />

Smith draw 9<br />

{ if ($1 != prev)<br />

{<br />

print $1 ":"<br />

prev = $1<br />

}<br />

print" "$2" "$3<br />

}<br />

Brown:<br />

# output<br />

eqn 1<br />

Jones:<br />

spell 5<br />

Smith:<br />

draw 9<br />

! Cooperation <strong>with</strong> <strong>the</strong> Shell<br />

To get field n into <strong>the</strong> awk program:<br />

awk '{ print $’$1’}'<br />

awk "( print \$ $1 )"<br />

! Multidimensional Arrays<br />

for (i = 1; i

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

Saved successfully!

Ooh no, something went wrong!