Example script: ex2.sh


   1: #!/bin/sh
   2: # Find an entry in the password file
   3: pwent=`grep '^richard:' /etc/passwd`
   4: # The "full name" and other comments are in
   5: # field 5, colon delimited
   6: OIFS=$IFS; IFS=: ; set $pwent; IFS=$OIFS
   7: echo $5



  last modified 02/04/2009 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College