Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Feb 2000 21:17:37 +0000
From:      Mark Ovens <mark@ukug.uk.freebsd.org>
To:        Darryl Hoar <darryl@osborne-ind.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: OFF TOPIC - Shell Script Question
Message-ID:  <20000208211737.C329@marder-1>
In-Reply-To: <001101bf7273$e44dc250$070101c0@ruraltel.net>
References:  <001101bf7273$e44dc250$070101c0@ruraltel.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 08, 2000 at 02:34:25PM -0600, 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 ?
> 

Try

	$ for i in `ls -lt | grep 1999 | awk '{print $9}'`
	> do
	> mv $i /home/darryl/test
	> done
	$

> BTW, I don't plan on doing this a bunch, so I would preferr Not to
> install, learn
> perl.  Instead, use the shell.
> 
> thanks,
> 
> Darryl Hoar
> Computer Programmer / Systems Analyst
> Osborne Industries, Inc.
> darryl@osborne-ind.com
> (785) 346-2192
> 
> PS.  If perls the only ticket, then I'll install and learn it.
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

-- 
	Microsoft: Where do you want to go today?
	Linux:     Where do you want to go tomorrow?
	BSD:       Are you guys coming, or what?
			              -Poster at LinuxWorld 2000
________________________________________________________________
      FreeBSD - The Power To Serve http://www.freebsd.org
      My Webpage http://ukug.uk.freebsd.org/~mark/
mailto:mark@ukug.uk.freebsd.org             http://www.radan.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000208211737.C329>