The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #3 (permalink)  
Old 07-22-2008
zaxxon's Avatar
zaxxon zaxxon is online now Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,285
snippet:

Code:
INFILE="./myserverlist"

if [[ $1 = "ALL" ]]; then
   while read SERVER PORT; do
      echo ${SERVER} ${PORT}
   done < ${INFILE}
else
   echo "No or wrong parameter!"
fi

exit 0
Change the "echo" vs. your start syntax.
You can parse other parameters with optargs or witch case/esac.


EDIT: Sorry, yes, Danmero is right, I was a bit too fast. Please use tags and show what you got next time.