On Thu, Sep 15, 2011 at 09:49:14AM +0200, Gérard Robin wrote: > Hello, > in order to organize outbox I wrote this script: (year.sh) > > --------------------------------------------------------- > #!/bin/bash > > year=`date +%Y` > > if [ ! -d ~/Mail/OUTBOX/$year ] > then > mkdir ~/Mail/OUTBOX/$year > echo 'set record==OUTBOX/$year/outbox-`date +%m-%y`' > else > echo 'set record==OUTBOX/$year/outbox-`date +%m-%y`' > > fi
As an aside, in addition to the responses you've had to your query, you have a redundant use of else in your script. It would work just as well written as #!/bin/bash year=`date +%Y` if [ ! -d ~/Mail/OUTBOX/$year ]; then mkdir ~/Mail/OUTBOX/$year fi echo "set record==OUTBOX/$year/outbox-`date +%m-%y`" Cheers, Tom -- The first thing I do in the morning is brush my teeth and sharpen my tongue. -- Dorothy Parker
signature.asc
Description: Digital signature