From owner-freebsd-questions Wed Feb 9 1: 8:40 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail1.noc0.hsacorp.net (mail1.noc0.hsacorp.net [208.247.171.140]) by builder.freebsd.org (Postfix) with ESMTP id B12C24376 for ; Tue, 8 Feb 2000 23:19:48 -0800 (PST) Received: from [24.216.177.226] (HELO kwan) by mail1.noc0.hsacorp.net (CommuniGate Pro SMTP 3.2b8) with ESMTP id 6929990; Wed, 09 Feb 2000 02:19:15 -0500 Message-Id: <4.3.0.33.0.20000209020237.00cbfd50@pseudonet.org> X-Sender: jconner@mail.enterit.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.0.33 (Beta) Date: Wed, 09 Feb 2000 02:19:32 -0500 To: jmutter@ds.net, darryl@osborne-ind.com From: Jim Conner Subject: Re: OFF TOPIC - Shell Script Question Cc: freebsd-questions@FreeBSD.ORG In-Reply-To: <38A0828F.6E5E703C@ds.net> References: <001101bf7273$e44dc250$070101c0@ruraltel.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 15:54 08-02-00 -0500, James A. Mutter wrote: >Darryl Hoar wrote: > > > > Greetings, > > I have a directory with a ton of files in it. I need to move some of > > them to another > > directory. Here's what I'm thinking: > > > > ls -tl | grep '1999' | awk '{print "mv " $9 " /home/darryl/test"}' > > > > but it does not 'execute' the mv command. How do I get this cooking ? > > > >And it's not going to execute the 'mv' command - no matter how hard you >try. :) >Instead, try something like this: > >for i in `ls -t`; do > mv $i /home/darryl/test >fi You could also use the find command (something like but not exactly cuz Im tired and can't remember all the correct args for find) find /home/darryl -name "*" -exec mv {} /home/darryl/test \; Something like that :) Sorry I couldn't be of too much more help. Jim >There are other ways to do this too - but I thought it might be useful >to see how a simple loop works in 'sh' > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Today's errors, in contrast: Windows - "Invalid page fault in module kernel32.dll at 0032:A16F2935" UNIX - "segmentation fault - core dumped" Humanous Beingsus - "OOPS, I've fallen and I can't get up" ------------------------------- Jim Conner NOTJames jconner@enterit.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message