Subject: Renaming copied files en masse....
To: None <port-arm32@NetBSD.ORG>
From: Bob <Bob@delacyst.demon.co.uk>
List: port-arm32
Date: 12/09/1997 18:59:59
Hi,

After re-reading my intial posting and talking to Theo I can see how
what I wrote before was a little ambiguous. My problem is that on the CD
(Datafile PDCD4), the files are BASE_SET_GZ etc as opposed to
BASE.SET.GZ which is what BSD wants, (and obviously RiscOS can't have a
file BASE.SET.GZ). Naturally, when these files are copied by RiscOS
using unixfs then they are copied as BASE_SET_GZ, or whatever. It is
using the '_' character along with the '*' wildcard that mv does not
like.  I can mv 'BASE_SET_GZ' to 'base.set.gz' no problem.  It's when
it comes to 'mv *_SET_GZ *.set.gz' or even 'mv *_GZ *.gz' that it
doesn't like it. And seeing as BASE is 13 different files let alone X or
anything else, this is a mighty tedious activity to rename them all one
by one.  

What I really need is a command which will rename the files probably
piping mv through sed or awk to get around the underscore problem.  Or
perhaps a script which loops until it can't find a file in that
directory with an underscore in it.  I think that this is what I was
probably intially looking for.  I assumed that seeing as there were
people with non standard Cumana drives / interfaces who had a working
setup of BSD that there would be a script floating around which took
care of this problem.  Also, with a minimal installion, ie none of the
sets installed, then I think I'm missing some of the basic Unix
utilities (although I could be mistaken).  Seeing as how I used to write
on HP UX as well and not netBSD I wondered if there were differing
syntaxes etc. between the different implementations of mv.

I now work on AS400's (horrible machines they are!) and I haven't
written a script for about two months, which is why I'm a little rusty
on Unix and looking for the easy way out ;-).
Does anybody have a script to solve this, or a suggestion as to how I
can work around it?  Or does it look like I'm going to have to go about
this the hard way and actually write the script myself? :-)

As always, thanks for any help / suggestions in advance

Bob
-- 
Bob@delacyst.demon.co.uk