lec09 - CS114 Lecture 9 More shell scripting HW3 due...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CS114: Lecture 9 More shell scripting HW3 due Wednesday. ..
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
A note on mountpoints What disk is /lib on? Mount doesn't show an entry for /lib But it must be on SOME disk. .. Perl is /usr/bin/perl ; mount has an entry for /usr , but not /usr/bin . So where is Perl?
Background image of page 2
Comments and newlines # to end of line is totally ignored (like // in Java or C++) # is the “comment character” in many scripting languages sh, csh, Perl, Python, Tcl, ruby, . .. Why? \ at end of line continues to next line (useful for looooong pipes)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Math in shell scripts expr 1 + 3 Prints 4 expr 2 \* 4 Prints 8 Spaces are important! expr 1+ 3 – error expr 1+3 Prints 1+3 (it's a string)
Background image of page 4
Bourne shell scripting: While loops #!/bin/sh i="" while [ "$i" \!= xxxxx ]; do echo Iteration $i i=x$i done How many loops? Why “$i” above? until ... do .. done (just like while but backwards)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
– many tests at once #!/bin/sh case $1 in [a-zA-Z]*) echo "$1 starts with a
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 12

lec09 - CS114 Lecture 9 More shell scripting HW3 due...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online