[Linux-disciples] write to file from shell script

Stephen R Laniel steve at stevereads.com
Tue Nov 15 23:06:45 EST 2011


::smacks forehead::

Gah. Yes, Dylan is right, of course. Good eye, gumshoe.

On Nov 15, 2011, at 11:04 PM, Dylan Paul Thurston wrote:

> The problem in the initial script, this one:
> 
> On Tue, Nov 15, 2011 at 09:28:09PM -0500, Jamie Forrest wrote:
>> #!/bin/bash
>> 
>> NOW=`date +%F`
>> gondor sqldump primary > $NOW_dump.sql
> 
> is that it's looking for a variable $NOW_dump, which doesn't exist.
> It probably created a file '.sql' as a result.  You can fix it like
> you did later, or by adding braces:
> 
> #!/bin/bash
> 
> NOW=`date +%F`
> gondor sqldump primary > ${NOW}_dump.sql
> 
> --Dylan
> _______________________________________________
> Linux-disciples mailing list
> Linux-disciples at lists.bostoncoop.net
> http://lists.bostoncoop.net/mailman/listinfo/linux-disciples
> 

-- 
Stephen R. Laniel
steve at stevereads.com
Cell: +(617) 308-5571
http://stevereads.com/
PGP key: http://stevereads.com/slaniel.key



More information about the Linux-disciples mailing list