I am trying to append a portion of a file with a date on it that changes daily to a temp file. Here are my commands:
set DATE = ('date +%Y%m%d_sum.log')
cat $HOME/right/$DATE > /export/home/temp.txt
Here is the error I keep receiving:
cat: cannot open /temp/usr/nedaniel/right/date
cat: cannot open +%Y%m%d_sum.log
No match
Can someone answer why the whole cat command is not being read and what I need to do to fix it?
Thanks.
anbu23
2
DATE=`date +%Y%m%d`"_sum.log"
I'm still receiving the same error.
anbu23
4
can you show the trace of the script?
Here is the whole script:
#!/bin/csh
rm /export/home/temp.txt
set DATE = 'date +%Y%m%'''d_sum.log'
cat $HOME/right/$DATE > /export/home/temp.txt
mailx -s "Job Sum <Log>" xxxxxx@xxxxxx.com < /export/home/temp.txt
I don't have any kind of trace. That is the whole script with this error:
cat: cannot open /temp/usr/nedaniel/right/date
cat: cannot open +%Y%m%d_sum.log
No match
anbu23
6
set DATE = `date +%Y%m%d`"_sum.log"
Use backticks instead single quotes