I am working on a shell script, and I have run into an issue with grep and spaces.
Can I do this or is there a better way?
Here is the part thats the problem
#################################################
for sat in HST ISS "STARSHINE 2" "STARSHINE 3"
do grep -A2 $sat /home/satdata >> datafile
#################################################
My problem is with the spaces in the items named STARSHINE 2 and STARSHINE 3. when they are assigned to $sat grep sees STARSHINE and 2 each as a seperate item. I have seen [:space:] , but cannot find much info on it.
Any suggestions?? Comments?? or a better way?
Thanks,
Chris
Can I do this or is there a better way?
Here is the part thats the problem
#################################################
for sat in HST ISS "STARSHINE 2" "STARSHINE 3"
do grep -A2 $sat /home/satdata >> datafile
#################################################
My problem is with the spaces in the items named STARSHINE 2 and STARSHINE 3. when they are assigned to $sat grep sees STARSHINE and 2 each as a seperate item. I have seen [:space:] , but cannot find much info on it.
Any suggestions?? Comments?? or a better way?
Thanks,
Chris