The script will append the fourth and any further space separated entries as a single variable, you could dispense with excess data simply by incorporating a simple line like.
IFS=' '
echo -e "Input Variables:-\c"
while read W X Y Z
Z=`echo ${Z} | awk '{ print $1 }'`
do
echo ${W};echo ${X};echo ${Y};echo ${Z}
done
Thanks again! One last question...I'm trying to understand the read command a little better. Is there an option where it reads only what the user inputs? Let me give an example of what i mean. Lets say the user inputs DOOR. I understand the read command will assign the value to the varable to "DOOR". But when I use that variable to search other files named "DOOR" it will return "DOOR" and "DOOR2ND". How can I make it to only return "DOOR"? Any insight will be greatly appreciated.
Here the problem is some what changed and is more dependent on how you search the file, so it is difficult to take a stab at this without knowing that information.
---------- Post updated at 07:53 AM ---------- Previous update was at 07:38 AM ----------
There's stuff in your script which can be changed such as redundant grep's etc.
Just looking at the pertinent points though, I would imagine that you would want something like this in replace of your first two lines (the printf and read):
max=5; set --
while [[ ($# -eq 0) || ($# -gt $max) ]] ; do
print "Please enter no more than $max account names: "
read -r input; set -- ${input}
IFS='|'; RE="$*"
done