Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: file names in arrays
- X-seq: zsh-users 9007
- From: Philippe Troin <phil@xxxxxxxx>
- To: zzapper <david@xxxxxxxxxx>
- Subject: Re: file names in arrays
- Date: 30 Jun 2005 10:12:23 -0700
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <j158c1pcrjsq040ej4efsa1nt6cp96vlar@xxxxxxx>
- Mail-copies-to: nobody
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <j158c1pcrjsq040ej4efsa1nt6cp96vlar@xxxxxxx>
zzapper <david@xxxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author