Re: shell script and variable problem

2006-12-01 Thread John L Fjellstad
Ken Irving <[EMAIL PROTECTED]> writes: > Not sure, but it'll work if you enclose the variable in quotes. That worked perfectly. Thanks. -- John L. Fjellstad web: http://www.fjellstad.org/ Quis custodiet ipsos custodes -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of

Re: shell script and variable problem

2006-12-01 Thread Ken Irving
On Fri, Dec 01, 2006 at 06:51:05PM -0900, Ken Irving wrote: > > The problem is that my test > > if [ -n $exlist -a -f $exlist ] > > does not work. For some reason, this always evaluate to true, and then > > the tar command fails. Why is this? > > Not sure, but it'll work if you enclose the varia

Re: shell script and variable problem

2006-12-01 Thread Ken Irving
On Fri, Dec 01, 2006 at 03:42:18PM -0800, John L Fjellstad wrote: > I have the following script I use for backup: > ### > #!/bin/sh > > BACKUPLIST=/etc/backup.lst > HOSTNAME=`hostname` > YEAR=`date +%Y` > MONTH=`date +%B` > BACKUPDIR=/srv/misc/backup/${YEAR}/${MONTH} > DATE=`date +%Y%m%d` > >

shell script and variable problem

2006-12-01 Thread John L Fjellstad
I have the following script I use for backup: ### #!/bin/sh BACKUPLIST=/etc/backup.lst HOSTNAME=`hostname` YEAR=`date +%Y` MONTH=`date +%B` BACKUPDIR=/srv/misc/backup/${YEAR}/${MONTH} DATE=`date +%Y%m%d` mkdir -m 2775 -p $BACKUPDIR for entry in `cat $BACKUPLIST`; do name=`echo $entry