Can anyone show me how to output my print command to a file in this ksh script. I tried to output this to a file called "testout" but it is not working. Can it be done with the print command?
#!/bin/ksh
DATE=`date`
SERVER=`uname -n`
FILELIST=/DJ/PUB/testfile
while read -r FNAME
do
if [ ! -f ${FNAME} ]
then
{ print -u2 "${DATE}-File Missing:${dir} ${FNAME}-On Machine:${SERVER}" ;
} > testout
fi
done < ${FILELIST}
#!/bin/ksh
DATE=`date`
SERVER=`uname -n`
FILELIST=/DJ/PUB/testfile
while read -r FNAME
do
if [ ! -f ${FNAME} ]
then
{ print -u2 "${DATE}-File Missing:${dir} ${FNAME}-On Machine:${SERVER}" ;
} > testout
fi
done < ${FILELIST}