$TRACES/batch/$Mil.$batch.log
is becoming /batch/20100319160018.afce01aa.cr.log
so I guess $TRACES
isn't defined.
I guess the /batch
directory doesn't exist.
Douglas Leeder
2010-03-19 15:17:58
$TRACES/batch/$Mil.$batch.log
is becoming /batch/20100319160018.afce01aa.cr.log
so I guess $TRACES
isn't defined.
I guess the /batch
directory doesn't exist.
you should define your TRACES
variable. Also, use $()
instead of backticks whenever possible.
TRACES="something here"
Mil=$(date +"%Y%m%d%H%M%S")
batch="${DatMusic}"
TabimportEnteteMusic="importentetemusic.dat"
{
grep '^ENTETE' "${IMPORT}/${DatMusic}" > "${IMPORT}/$TabimportEnteteMusic"
mysql -u basemine --password="basemine" -D basemine -e "delete from importmusic;"
mysql -u basemine --password="basemine" -D basemine -e "delete from importentetemusic;"
} >> $TRACES/batch/${Mil}.${batch}.log 2>&1
The error message speaks about the /batch/20100319160018.afce01aa.cr.log file.
This means that $TRACES/batch/${Mil}.${batch}.log is replaced by /batch/20100319160018.afce01aa.cr.log
This means that the $TRACES variable can't be defined at the place you are using it (event if you repeat one hundred times "$TRACE is an environment variable and is defined").
Try a
echo "\$TRACES $TRACES"