From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11734 invoked from network); 17 Dec 2003 10:57:42 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 17 Dec 2003 10:57:42 -0000 Received: (qmail 24161 invoked by alias); 17 Dec 2003 10:57:28 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6908 Received: (qmail 24130 invoked from network); 17 Dec 2003 10:57:27 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 17 Dec 2003 10:57:27 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 17 Dec 2003 10:57:27 -0000 Received: from EXCHANGE02.csr.com (unverified) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Wed, 17 Dec 2003 10:56:19 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 17 Dec 2003 10:58:02 +0000 To: zsh-users@sunsite.dk Subject: Re: Creating a directory with a date-based name In-reply-to: "zzapper"'s message of "Wed, 17 Dec 2003 10:45:09 GMT." <1kc0uvc2je7sklkfapdogigrl93fhhk0p2@4ax.com> Date: Wed, 17 Dec 2003 10:56:24 +0000 Message-ID: <2075.1071658584@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 17 Dec 2003 10:58:02.0483 (UTC) FILETIME=[A4248C30:01C3C48C] zzapper wrote: > > Hi Ya, > > I'm a zsh newbie. > > I have the following bash script, which will create a directory say > 06Dec03 if this directoryy exists then create 06Dec03v2 > > I need to enhance it to create 06Dec03v3,4,5,6 etc. should these > directories exist. > > How would this best be done in zsh? integer vers=2 while [[ -d ${dat}v$vers ]]; do (( ++vers )) done mkdir ${dat}v$vers (actually the same in bash, as far as I can see.) -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************