I wonder why the below tiny script is now working. I created dfFile under /data directory but script does not print the expressions in if statement.
#!/bin/ksh
DATAFILE="/data/dfFile"
echo $DATAFILE
#df -h>/data/dfFile
if [[ -e DATAFILE ]]
then
echo "sa"
echo $DATAFILE
df -h > $DATAFILE
fi
That should read
if [[ -e "$DATAFILE" ]]