Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Nov 2007 17:34:45 -0000
From:      "Barry Byrne" <barry.byrne@wbtsystems.com>
To:        "'Bill Banks'" <office@ourweb.net>, "'FreeBSD Questions'" <freebsd-questions@freebsd.org>
Subject:   RE: shell programming
Message-ID:  <00b101c826e4$a5c06eb0$c5010c0a@SUNYA>
In-Reply-To: <473B2F54.7030208@ourweb.net>
References:  <47349D10.20709@ourweb.net><20071109193001.Y20961@wojtek.tensor.gdynia.pl> <473B2F54.7030208@ourweb.net>

next in thread | previous in thread | raw e-mail | index | archive | help

> -----Original Message-----
> From: owner-freebsd-questions@freebsd.org 
> [mailto:owner-freebsd-questions@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 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00b101c826e4$a5c06eb0$c5010c0a>