zsh-users
 help / color / mirror / code / Atom feed
From: nirva@bleep.ishiboo.com
To: schaefer@brasslantern.com (Bart Schaefer)
Cc: guckes@math.fu-berlin.de, zsh-users@math.gatech.edu
Subject: Re: renaming with number prefix
Date: Tue, 27 Jan 1998 20:21:27 -0500 (EST)	[thread overview]
Message-ID: <19980128012127.19751.qmail@bleep.ishiboo.com> (raw)
In-Reply-To: <980123091904.ZM16897@candle.brasslantern.com> from Bart Schaefer at "Jan 23, 98 09:19:04 am"

Bart Schaefer stands accused of saying:
> On Jan 23,  4:54pm, Sven Guckes wrote:
> } Subject: renaming with number prefix
> }
> } 	$ ls
> } 	abc bar baz foo zyxxy
> } 	$ <command>
> } 	$ ls
> } 	1.abc 2.bar 3.baz 4.foo 5.zyxxy
> } 
> } So - what's that <command>?
> 
>     integer i=0; for f in *; do mv $f $[i+=1].$f; done
> 
> } Btw, "leading zeroes" would be a bonus.
> 
> How many leading zeros?  I'm guessing 3 digits total would be OK:
> 
>     typeset -Z 3 i=1 ; for f in *; do echo $f $i.$f; ((++i)); done
> 
> Too bad $[i+=1] doesn't respect the typeset flags of `i' when printing.

typeset -Z 3 i=1 ; for f in *; do echo $f $i.$f; typeset -Z 3 i=$((++i)); done

---------------------------------------------------------------------------
Danny Dulai                                           Feet. Pumice. Lotion.
http://www.ishiboo.com/~nirva/                            nirva@ishiboo.com
---------------------------------------------------------------------------


  reply	other threads:[~1998-01-28  1:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-23 15:54 Sven Guckes
1998-01-23 16:21 ` Thomas Koehler
1998-01-23 16:24 ` Bruce Stephens
1998-01-23 16:40 ` Nate Johnston
1998-01-23 17:09 ` Stephen Marley
1998-01-23 17:19 ` Bart Schaefer
1998-01-28  1:21   ` nirva [this message]
1998-01-23 17:28 ` Peter Williams
1998-01-23 21:47 ` Ulrich Pfeifer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19980128012127.19751.qmail@bleep.ishiboo.com \
    --to=nirva@bleep.ishiboo.com \
    --cc=guckes@math.fu-berlin.de \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).