# Filename problem



## yhq_34 (Sep 3, 2016)

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:
	
	



```
./smart: SMARTFILE: not found
```
, how can I modify to make it work?

```
SMARTFILE = `date "+%Y%m%d%H%M%S"`
smartctl -d auto -a /dev/ada0 > $SMARTFILE
```


----------



## getopt (Sep 3, 2016)

```
#!/bin/sh                                                                   
now=$(date +%Y%m%d%H%M%S)                                                   
myfilename=$now                                                             
echo "DOIT!" > ${myfilename}
```


----------



## tobik@ (Sep 3, 2016)

yhq_34 said:


> 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:
> 
> 
> ...


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.


----------

