I have created a Bourne Shell script that is supposed to execute Perl
commands to change multiple dates within a file. We found that we could
not use sed because it changes the number of bytes in the file, which
causes an out of synch situation with our program...Problem:
The script seems to never write out...What can I do to solve this
problem? Here is the code in general:
#!/bin/sh
myname="/opt/jets/users/`whoami`/PNRForward"
if test -f $myname
then
echo "$0: Cannot make directory $myname (already exists)" 1&>2
exit 0
fi
echo "Enter the filename you want to age forward \c"
read FILENAME
mkdir "$myname"
echo "PNRForward is now in progress....go get a cup of coffee... \c"
perl -pe 's/18JUN/13aug/g'; \
-pe 's/19JUN/14aug/g'; \
-pe 's/20JUN/15aug/g'; \
-pe 's/21JUN/16aug/g'; \
-pe 's/22JUN/17aug/g'; \
-pe 's/23JUN/18aug/g'; \
-pe 's/24JUN/19aug/g'; \
$FILENAME > "$myname"/"$FILENAME`date +_%m%d%H%M%S`"
echo "done"
Thanks for any pointers.
A.