From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15645 invoked from network); 30 Jun 2005 17:13:56 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Jun 2005 17:13:56 -0000 Received: (qmail 3835 invoked from network); 30 Jun 2005 17:13:49 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Jun 2005 17:13:49 -0000 Received: (qmail 5764 invoked by alias); 30 Jun 2005 17:13:42 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9007 Received: (qmail 5749 invoked from network); 30 Jun 2005 17:13:41 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 30 Jun 2005 17:13:41 -0000 Received: (qmail 2765 invoked from network); 30 Jun 2005 17:13:41 -0000 Received: from tantale.fifi.org (64.81.251.130) by a.mx.sunsite.dk with SMTP; 30 Jun 2005 17:13:34 -0000 Received: from ceramic.fifi.org (Debian-exim@ceramic.fifi.org [64.81.251.131]) by tantale.fifi.org (8.9.3p2/8.9.3/Debian 8.9.3-21) with ESMTP id KAA05874; Thu, 30 Jun 2005 10:12:23 -0700 Received: from phil by ceramic.fifi.org with local (Exim 4.34) id 1Do2aN-0000x9-Ei; Thu, 30 Jun 2005 10:12:23 -0700 To: zzapper Cc: zsh-users@sunsite.dk Subject: Re: file names in arrays References: Mail-Copies-To: nobody From: Philippe Troin Date: 30 Jun 2005 10:12:23 -0700 In-Reply-To: Message-ID: <87ekajdb0o.fsf@ceramic.fifi.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 zzapper 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.