The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 02-14-2008
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,554
Quote:
Originally Posted by otheus View Post
In ksh and bash, you can also parse out the first word from the rest:

Code:
case "${line%% *}" in
   first|second|third) echo "$line";;
esac

Code:
while read -r a b
do
 case $a in 
  ....
 esac
done