You both are on the right track as to what I am trying to do...
the code is as follows for the script I am working on:
#!/bin/ksh
. /u/ucommands/u2tat
rm /tmp/blah.dat >/dev/null 2>&1
range1=1
range2=1
filename=$0
echo "This script will query the database for a range of projects and return the projects units that are marked as a A or I and the address of the unit."
echo ""
echo "Please enter the first project, NOTE if you only wish for one project to be displayed enter the same project number at both prompts."
read range1
echo "Enter the other project number."
read range2
if test -s /tmp/blah.dat
then
echo "File write successful!"
echo $filename
sed '$filename test' ./good.txt | mail -t
myemail@mail.ca
else
echo "File write Failure..zero length file or no data to write"
fi
now the good.txt file is
the following program has ran: "this is where the name of the script is going to be"
bobnoff what is the $a in your statement I assume it the scripts name? when I run I get and error on the sed statement.