I'd like to have the output from this script piped to a text file that has the date at the beginning of it. For example, my ideal would be something like this
$./run_script.sh
$ls *.out
2013-Feb-26-output_filename.out
Here's the code I'm using.
#! /bin/ksh
DAT=`date '+%Y-%b-%d'`
for d in /dir1 /dir2 /dir3
do
df -h $d|tail -1
done|>> $DAT_disk_usage.out
Instead of the output I'm expecting I get nothing... what am I missing?