From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9551 invoked from network); 2 Jul 2005 20:52:01 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Jul 2005 20:52:01 -0000 Received: (qmail 22496 invoked from network); 2 Jul 2005 20:51:53 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Jul 2005 20:51:53 -0000 Received: (qmail 22995 invoked by alias); 2 Jul 2005 20:51:46 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9010 Received: (qmail 22984 invoked from network); 2 Jul 2005 20:51:46 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Jul 2005 20:51:46 -0000 Received: (qmail 21318 invoked from network); 2 Jul 2005 20:51:46 -0000 Received: from vms048pub.verizon.net (206.46.252.48) by a.mx.sunsite.dk with SMTP; 2 Jul 2005 20:51:41 -0000 Received: from candle.brasslantern.com ([71.116.88.149]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IJ000G9PPY3O2U9@vms048.mailsrvcs.net> for zsh-users@sunsite.dk; Sat, 02 Jul 2005 15:51:40 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j62Kpc0A004703 for ; Sat, 02 Jul 2005 13:51:38 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j62KpcUx004702 for zsh-users@sunsite.dk; Sat, 02 Jul 2005 13:51:38 -0700 Date: Sat, 02 Jul 2005 20:51:37 +0000 From: Bart Schaefer Subject: Re: file names in arrays In-reply-to: To: zsh-users@sunsite.dk Message-id: <1050702205137.ZM4701@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: Comments: In reply to zzapper "file names in arrays" (Jun 30, 4:51pm) 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=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Jun 30, 4:51pm, zzapper wrote: } } 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. Go to http://www.zsh.org/cgi-bin/mla/wilma/users and search for "keeper". } And then this array is looped thru with a promt deciding what might } happen to these files, mv,rm,cp edit etc Isn't the answer to this the same as -- or awfully similar to, at any rate -- the answer to your "Creating a Case statement dynamically" thread from a couple of days earlier? local file command target find "$@" | keep for file in $kept do PS3="Action on $file: " target='' select command in mv cp rm gvim do case $REPLY in ((Q|q)*) break 2;; (<1->) case $command in (cp|mv) vared -e -p "$command $file " target && [[ -n $target ]] && $command $file $target (?*) $command $file;; (*) break;; esac;; (*) break;; esac done done