Re: [Linuxcommand-discuss] question about redirection
Brought to you by:
bshotts
From: Bram M. <bra...@li...> - 2004-02-11 16:11:00
|
On Wed, 2004-02-11 at 15:51, William Shotts wrote: > Yes, by all means you would want to use a variable instead. It would make > your script easier to maintain. I would suggest that in keeping with > convention, the name of the variable should have an uppercase name since > it you are treating the variable as a constant. After editing the script I get the following errors: m8ram@linux:~> bin/startevo bin/startevo: line 3: =/data/logs/evolution.log: No such file or directory bin/startevo: line 4: $LOGFILE: ambiguous redirect bin/startevo: line 5: $LOGFILE: ambiguous redirect bin/startevo: line 6: $LOGFILE: ambiguous redirect This is what the script looks like now: m8ram@linux:~> cat bin/startevo #!/bin/bash $LOGFILE="/data/logs/evolution.log" echo "" >> $LOGFILE echo "--- $(date +"%R %A, %B %-d, %Y") ---" >> $LOGFILE evolution >> $LOGFILE 2>&1 The file does exist and is writable: m8ram@linux:~> ls -lh /data/logs/evolution.log -rw-r--r-- 1 m8ram users 50K 2004-02-11 16:58 /data/logs/evolution.log Why is bash looking for a file called '=/data/logs/evolution.log' ? The quotes are correct, aren't they? TIA -- # Mertens Bram "M8ram" <bra...@li...> Linux User #249103 # # SuSE 8.2 Pro kernel 2.4.20-4GB i686 128MB RAM # # 5:06pm up 19 days 20:43, 5 users, load average: 0.56, 0.20, 0.10 # |