Filename problem

I want output smart-hdd to a file which named as date format,
so I make below script, but every time I run it will show:
Code:
./smart: SMARTFILE: not found
, how can I modify to make it work?
Code:
SMARTFILE = `date "+%Y%m%d%H%M%S"`
smartctl -d auto -a /dev/ada0 > $SMARTFILE
 
I want output smart-hdd to a file which named as date format,
so I make below script, but every time I run it will show:
Code:
./smart: SMARTFILE: not found
, how can I modify to make it work?
Code:
SMARTFILE = `date "+%Y%m%d%H%M%S"`
smartctl -d auto -a /dev/ada0 > $SMARTFILE
You're getting the error because the shell thinks SMARTFILE is a command that it should run. Remove the spaces before and after the = to make it work.
 
Back
Top