[Linux-disciples] write to file from shell script

Jamie Forrest jamie at jamieforrest.com
Tue Nov 15 21:28:09 EST 2011


What am I doing wrong? I am trying to write to a file from within a
shell script, but the file doesn't get created. Here's the script:

#!/bin/bash

NOW=`date +%F`
gondor sqldump primary > $NOW_dump.sql


(For what it's worth gondor sqldump is a command that dumps a remote
database to sql (primary is the db instance). Generally when I run it
from the cmd line I just run gondor sqldump primary >
whatever_dump.sql and all is fine. I know this command is running ok
because I see its output "Dumping database... [ok]" when I run the
script.)

Thanks,
Jamie


More information about the Linux-disciples mailing list