[prog] [Bash] script question

Shuying shuyingw at cse.unsw.EDU.AU
Sun Sep 29 17:00:58 EST 2002


Heya,

I've written a small script that doesn't do what I want it to do,
namely rename all files in a particular directory and then zip them all
up...Can any one tell me what I've done wrong?

#!/bin/sh

maildir=~shuyingw/mail
datestamp=`date +%b-%Y`

for file in $maildir
do
  mv $file $file-$datestamp
  touch $file
done

tar cjvf - $maildir/*$datestamp > /tmp/mail-$datestamp.tar.bz2


cheers,
Shuying






More information about the Programming mailing list