zsh-users
 help / color / mirror / code / Atom feed
From: Philippe Troin <phil@fifi.org>
To: zzapper <david@tvis.co.uk>
Cc: zsh-users@sunsite.dk
Subject: Re: file names in arrays
Date: 30 Jun 2005 10:12:23 -0700	[thread overview]
Message-ID: <87ekajdb0o.fsf@ceramic.fifi.org> (raw)
In-Reply-To: <j158c1pcrjsq040ej4efsa1nt6cp96vlar@4ax.com>

zzapper <david@tvis.co.uk> writes:

> Hi,
> At the risk of being abused, RTFM etc etc
> 
> Has anyone got a script where a number of file names resulting from
> say a find/grep are loaded into an array.
> 
> And then this array is looped thru with a promt deciding what might
> happen to these files, mv,rm,cp edit etc

a=(${(ps:\0:)"$(find /path -print0)"})
for i in $a
do
  while :
  do
    print -n "Frob $i? (y/n) "
    read r
    case $r in
      ([yY]) frob $i; break;;
      ([nN]) break;;
      (*)    print "invalid input";;
    esac
  done
done

You get the idea...
Phil.


  reply	other threads:[~2005-06-30 17:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-30 15:51 zzapper
2005-06-30 17:12 ` Philippe Troin [this message]
2005-07-02 20:51 ` Bart Schaefer
2005-07-04 12:06   ` zzapper
2005-07-04 14:09     ` Bart Schaefer
2005-07-04 15:31       ` zzapper
2005-07-04 17:33         ` zzapper

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=87ekajdb0o.fsf@ceramic.fifi.org \
    --to=phil@fifi.org \
    --cc=david@tvis.co.uk \
    --cc=zsh-users@sunsite.dk \
    /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).