[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Stupid unix



On 23-Jul-98 Jack A Walker wrote:
> Please excuse this lame non Debian specific question.  Is there a simple
> way to change all filenames in a directory so they are lowercase?  I would
> like to change all the *.cpp and *.h files in a project directory to be
> lowercase letters only.  I know this seems like a lame task but it would
> simplify working on some of my source at home on Linux.  I use Windoesn't
> 4.0 at work which retains name case but doesn't use it.

Not so lame, I think ...

Try

  for i in *.cpp ; do j=`echo "$i" | tr '[A-Z]' '[a-z]'` ; mv $i $j; done
  for i in *.h   ; do j=`echo "$i" | tr '[A-Z]' '[a-z]'` ; mv $i $j; done

but I STRONGLY suggest you first try it out on a dummy directory which you have
populated with a suitable variety of filenames, just to check that it really
does what you want and nothing else. (Also to make sure you got it exactly
right -- watch out for those quotes).

Also, ABOVE ALL make sure that there are not two or more files in the same
directory whose names differ only in the Case of some of the letters -- you'll
end up zapping all but one of them if you use the above.

Best of luck,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk>
Date: 23-Jul-98                                       Time: 18:41:12
--------------------------------------------------------------------


--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: