Stupid Scripting Question
I am trying to write a simple bash script to replace the system.mwmrc with a modified one. There are currently 3 possible versions of system.mwmrc out there depending upon what type of terminal they have. We gave them a menu to select the terminal type depending upon their location in the store.
In the system.mwmrc there is a line that says :
!pbyver: RETAIL SETUP
or
!pbyver: SERVICE SETUP
depending on which terminal type it is.
My script will not work as I have written it :
#!/bin/bash
#set -x
THIS=`grep pbyver /usr/X11R6/lib/X11/system.mwmrc | awk -F ":" '{print $2}'`
if [ $THIS = "RETAIL SETUP" ] ; then
echo "TADA"
fi
exit 0
( Obvously the echo TADA is just to test the script. I expect the script to be a run once deal)
I keep getting messages about too many arguments in line 5 ( the if statement )
If I physically change the line in system.mwmrc to pby:RETAIL and change the if statement as well, it works. It appears that the script doesn't like the SPACES in the pbyver line. Is there anyway I can get this to work? Can I just fix on the first word somehow if need be?
I feel pretty stupid with this question....
Thanks,
Steve
|