Problem with Bash Script
Hi All,
I'm trying to create a bash script to do the following: * Mount an NFS dir to local MNT * Copy cups ppd file from MNT to /etc/cups/ppd * Substitute entries for old printer to new in /etc/cups/printers.conf * Restart cups Here is the code: #!/bin/sh -x EXPORT=unix_vs:/unix/export MNT=/mnt/printer FILE=/is/ppd/ps9.ppd PRINT_CONF=/etc/cups/printers.conf PPD=/etc/cups/ppd CUPS=/etc/cups # Create MP for /unix/export # and copy ppd file to local # ppd dir in /etc/cups if [ ! -d $MNT ]; then echo "Create MNT!" mkdir -p $MNT else echo "Dir Exists! fi mount $EXPORT $MNT cp -p $MNT/$FILE $PPD # Backup up printers.conf file # and edit with sed if [ -f $PRINT_CONF ]; then cp -p $PRINT_CONF $PRINT_CONF.orig fi # unalias cp sed -e "s/ps6/ps9/g;s/P4010/P4015x/g" \ $PRINT_CONF > $PRINT_CONF.tmp cp -u $PRINT_CONF.tmp $PRINT_CONF # Restart the cups daemon /etc/init.d/cups restart When I run the code I get the following: # ./ps9-install.sh ./ps9-install.sh: line 30: unexpected EOF while looking for matching `"' ./ps9-install.sh: line 36: syntax error: unexpected end of file Any help would be appreciated Thx... |
Code:
sed -e "s/ps6/ps9/g;s/P4010/P4015x/g" \ Code:
cp -u $PRINT_CONF $PRINT_CONF.old |
The error message is telling you the problem.
Code:
unexpected EOF while looking for matching `"' Code:
echo "Dir Exists! PS: Please use [code][/code] tags around your code, to preserve formatting and to improve readability. |
Thanks!
Guys, thanks for your responses...the problem turned out to be the missing " as David the H had mentioned. I apologize for the missing tags, but I didn't see there mention when I was creating the post, so I wasn't sure if they were required.
Thanks Again! |
Please mark as SOLVED if you have a working solution.
|
All times are GMT -5. The time now is 10:44 PM. |