Hi all. The trouble that I have run into is the printf command. We have a bunch of batteries here for our scan guns. They all have a certain number and barcode on them and whenever we change a battery, we scan the battery in and out. The script that I have written is, to enter on of these numbers and it will display every record for that particular battery. It dispays the information correctly, but it's not organized enough to suit my boss (big suprise). Anyway, I'm a newer user to AIX and the man files aren't helping very much. Here is my script.
# /bin/ksh!
echo "\tPlease enter the battery number you wish to search for..."
read ans
if [[ $ans != 0 ]]
then
cat /dso/eis/log/batlog.log.* |grep $ans > /dso/eis/log/battsearch.log
more /dso/eis/log/battsearch.log
fi
echo "\tWould you like to print this? (y/n)"
read ans1
if [ $ans1 = "y" -o $ans1 = "Y" ]
then
lp -dps@pr7 /dso/eis/log/battsearch.log
else
exit
fi
And here is the output
,06/29/03,22:04,9901538,Cory Cole,DCO,OUT,4270801,PROD
So my question is, how do I use the printf command to get this information organized? Thanks for any help I get.
Jason
# /bin/ksh!
echo "\tPlease enter the battery number you wish to search for..."
read ans
if [[ $ans != 0 ]]
then
cat /dso/eis/log/batlog.log.* |grep $ans > /dso/eis/log/battsearch.log
more /dso/eis/log/battsearch.log
fi
echo "\tWould you like to print this? (y/n)"
read ans1
if [ $ans1 = "y" -o $ans1 = "Y" ]
then
lp -dps@pr7 /dso/eis/log/battsearch.log
else
exit
fi
And here is the output
,06/29/03,22:04,9901538,Cory Cole,DCO,OUT,4270801,PROD
So my question is, how do I use the printf command to get this information organized? Thanks for any help I get.
Jason