Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Creating a directory with a date-based name



On Wed, 17 Dec 2003 11:58:05 +0100, Dominik Vogt <dominik.vogt@xxxxxx>
wrote:

Hi,
My final script (thanx)

dirbackup="c:/backup/mysqlnext/"
cd "$dirbackup"
eval origdat=$(date.exe '+%d%b%y')

if ! mkdir "$dat"; then
     i=1
     finished=""
     while [ -z "$finished" ] && [ "$i" <= 9 ]; do
       i=$[i+1]
       dat="${origdat}v$i"
       if mkdir "$dat"; then
           finished="end"
           echo "created $dat"
       fi
     done
fi
cd $dat

zzapper (vim & zsh)
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305  Best of Vim Tips



Messages sorted by: Reverse Date, Date, Thread, Author