Hey all
so... my project this time is a little different:
I'm creating a login that will run the following script at logon (adding it to .bash_login file after scripts are finished):
Code:
#!/bin/bash
echo "What would you like to do?"
echo "Press "n" to burn a normal Products CD
echo "Press "r" to burn a RACE Products CD
echo "Press "q" to quit and logout
read REPLY
if [ "$REPLY" == "n" ]; then
sh /home/cdburn/Normal_CD.sh
command clear
elif [ "$REPLY" == "r" ]; then
sh /home/cdburn/Race_CD.sh
command clear
elfi [ "$REPLY" == "q" ]; then
break
fi
done
kill -HUP $PPID
the Normal_CD.sh and Race_CD.sh scripts perform correctly by themselves, but when calling the scripts from this one I get an error that states the following:
/home/cdburn/Normal_CD.sh: 19: [: y: unexpected operator
for reference, one of the scripts it's calling is as follows:
Code:
#!/bin/bash
## setting variables
SOURCE="/dir/to/source/files"
ISO="/dir/to/store/ISO/file"
## Generating ISO file based on Source
rm $ISO
genisoimage -r -J -o $ISO $SOURCE
command clear
## Starting Burn Process
While true; do
echo "Has a blank CD been inserted? (y/n): "; read REPLY;
if [ "$REPLY" == "n" ]; then
wodim -eject
command clear
echo Please insert a blank disk
elif [ "$REPLY" == "y" ]; then
wodim -v -eject dev=dev/sg1 -data $ISO;
break
fi
done
command clear
while true; do
echo "Do you wish to burn another? (y/n): "; read REPLY;
if [ "$REPLY" == "y" ]; then
command clear
echo "waiting 5 seconds for a blank disk"
sleep 5
command clear
wodim -v -eject dev=/dev/sg1 -data $ISO
command clear
elif [ "$REPLY" == "n" ]; then
break
fi
done
echo "Returning to Main Menu"
Any ideas on why the Normal_CD.sh would break when getting called from the login.sh?
Thanks for the help!
Bookmarks