Bash Shell script problem after upgrade

Maxime Alarie malarie at processia.com
Tue Jan 4 16:40:36 UTC 2011


-----Original Message-----
From: ubuntu-users-bounces at lists.ubuntu.com
[mailto:ubuntu-users-bounces at lists.ubuntu.com] On Behalf Of Linda
Sent: 03 January 2011 11:46
To: ubuntu-users at lists.ubuntu.com
Subject: Bash Shell script problem after upgrade

I have bash shell scripts that ran under LTS 8.04 and no longer work.
They still ask the questions for the variables but the output file is
not created. I have tried to keep the bones of the script and have
gotten rid of most of the content that is echoed to the file. I tried
commenting out the lpr command and the file is not created. Why would
this file that has worked since the 1980s no longer create a file with
LTS 10.04.
               Thanks
               Linda

# Rprice_ prints price list
#!/bin/bash
TEMP=/usr/local/lib/tmp/price$$
EMAIL=/usr/local/lib/email/price$$
echo "What type of price list do you want? (Q P )"
read style
echo "How many copies do you want? "
read copies
case $style in
   p|P) type=PREMIUM
      file=/usr/local/lib/price/$type
      if [ ! -f "$file" ] ; then
         echo "$file does not exist, Hit return to continue."
         exit
      fi
      cat /usr/local/lib/misc/Lhead.ps >> $TEMP
      echo ' /Times-Roman 12 selectfont ' >> $TEMP
      echo "176 625 moveto (2011 RENTAL SIZES \& PRICES - PAGE 1) show "
>> $TEMP
      cat /usr/local/lib/misc/reg-ps.1 >> $TEMP
      ;;
   q|Q) type=QUALITY
      file=/usr/local/lib/price/$type
      if [ ! -f "$file" ] ; then
         echo "$file does not exist, Hit return to continue."
         exit
      fi
      cat /usr/local/lib/misc/Lhead.ps >> $TEMP
      echo ' /Times-Roman 12 selectfont ' >> $TEMP
      echo "176 625 moveto (2011 RENTAL SIZES & PRICES - PAGE 5) show "
>> $TEMP
      cat /usr/local/lib/misc/reg-ps.2 >> $TEMP
      ;;
esac
ps2pdf -sPAPERSIZE=letter $TEMP $EMAIL
lpr -#"$copies" -r  $TEMP


-- 
ubuntu-users mailing list
ubuntu-users at lists.ubuntu.com
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users





Throw a set -x at the beginning of your script..   It will help finding
the  error.




More information about the ubuntu-users mailing list