Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 1999 19:11:14 +0000
From:      Ben Smithurst <ben@scientia.demon.co.uk>
To:        Keith Anderson <keith@apcs.com.au>
Cc:        questions@freeBSD.org
Subject:   Re: omething simple (sorry)
Message-ID:  <19990304191114.A11792@scientia.demon.co.uk>
In-Reply-To: <XFMail.990304231927.keith@apcs.com.au>
References:  <XFMail.990304231927.keith@apcs.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Keith Anderson wrote:

> I have looked and I can't find how to move bulk files with wildcards
> 
> in dos I would use copy *.txt *.old

Cp and mv can't do this alone, since your shell will expand the wilcards
before they see them. And if you protect the wildcard characters, cp and
mv won't expand them at all. Try something like this, in /bin/sh and
friends:

for i in *.txt; do mv $i $(basename $i .txt); done

Replace "mv" with "cp" if you want to copy rather than just move/rename
the files.

-- 
Ben Smithurst
ben@scientia.demon.co.uk

send a blank message to ben+pgp@scientia.demon.co.uk for PGP key


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?19990304191114.A11792>