| Text-only | Table of Contents (frame/ no frame) |
| (20) Conditional test examples |
|
case with a pattern:
case $var in/*) echo "starts with /" ;;
`cut`:
if [ "`echo $var | cut -c1`" = "/" ] ; then .
if [ "${var%${var#?}}" = "/" ]; then
if [[ $var = /* ]]; then
if [ "${var:0:1}" = "/" ]; then
${varname:start:length}
| flow-control-ex.src last modified Mar 11, 2005 | Introduction | Table of Contents (frame/no frame) |
Printable (single file) |
© Dartmouth College |