Problem with Bash Script
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:
# 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
echo "Dir Exists!
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
# 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
When I run the code I get the following:
./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
The error message is telling you the problem.
PS: Please use [code][/code] tags around your code, to preserve formatting and to improve readability.
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.
Please mark as SOLVED if you have a working solution.
|All times are GMT -5. The time now is 07:32 AM.|