shell programming

Barry Byrne barry.byrne at wbtsystems.com
Wed Nov 14 09:51:27 PST 2007


> -----Original Message-----
> From: owner-freebsd-questions at freebsd.org 
> [mailto:owner-freebsd-questions at freebsd.org] On Behalf Of Bill Banks
> Sent: 14 November 2007 17:25
> To: FreeBSD Questions
> Subject: Re: shell programming
> 
> What am I doing wrough here:
> 
> #!/bin/sh
>  $DAYN='/bin/date +%a' + "_master.sql"
>  mysqldump master > $DAYN

Your quotes should be backticks not single quotes.
Also drop the $ from before the variable name when assigning.

#!/bin/sh
DAYN=`/bin/date +%a`
DAYN="${DAYN}_master.sql"

 -  barry 



More information about the freebsd-questions mailing list