From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9324 invoked from network); 31 Oct 2006 16:51:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 31 Oct 2006 16:51:41 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 4283 invoked from network); 31 Oct 2006 16:51:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 31 Oct 2006 16:51:35 -0000 Received: (qmail 28822 invoked by alias); 31 Oct 2006 16:51:25 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10916 Received: (qmail 28812 invoked from network); 31 Oct 2006 16:51:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 31 Oct 2006 16:51:25 -0000 Received: (qmail 3224 invoked from network); 31 Oct 2006 16:51:25 -0000 Received: from wx-out-0506.google.com (66.249.82.237) by a.mx.sunsite.dk with SMTP; 31 Oct 2006 16:51:21 -0000 Received: by wx-out-0506.google.com with SMTP id s7so1681525wxc for ; Tue, 31 Oct 2006 08:51:20 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=qR8fnG92YaKU85XYz1VCahW9BS6tHKZd6+LeSH1HYT5pCWeQMCC1zMido9qESVb8okKcy73YQBcwqZEdOkz6fuxV0/fQjv1ghoVfVsZsWcTJYWvlfWXlxKUq93occ4nrZJf9t/wWtR8hqJ/YEN5awiCGIShWnHoC/+QGAH0qGKw= Received: by 10.90.94.2 with SMTP id r2mr2412878agb; Tue, 31 Oct 2006 08:51:20 -0800 (PST) Received: by 10.90.66.14 with HTTP; Tue, 31 Oct 2006 08:51:20 -0800 (PST) Message-ID: Date: Tue, 31 Oct 2006 17:51:20 +0100 From: "Nikolai Weibull" Sender: nikolai.weibull@gmail.com To: zzapper Subject: Re: 'mv' all files containing a certain string to a sub-directory Cc: zsh-users@sunsite.dk In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200610311419.k9VEJaKf009817@news01.csr.com> X-Google-Sender-Auth: 7cc438180a29a110 On 10/31/06, zzapper wrote: > Peter Stephenson wrote in news:200610311419.k9VEJaKf009817 > @news01.csr.com: > > > zzapper wrote: > >> I want to 'mv' all files containing a certain string to a sub-directory. > >> Should be trivial but cant think how w/o creating a temporary file > > > > mv *(.e:'grep -q string $REPLY':) subdir > > > Seeing PWS's reply reminded me of the conventional way to do this > > mv $(grep -il "userid" *.php) done That doesn't work with files with spaces in them, though. nikolai