Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 12-22-2003, 08:12 PM   #1
LQ Newbie
Registered: Nov 2001
Posts: 11

Rep: Reputation: 0
sed or awk question - replace caps with small letters

want to run a command on a directory, to change all file names in capital letters to small caps..

any suggestions?

much thanks
Old 12-30-2003, 05:39 AM   #2
LQ Newbie
Registered: Dec 2003
Location: Den Haag, The Netherlands
Distribution: RedHat AS 2.1
Posts: 16

Rep: Reputation: 0
You could do it with a simple script like:

files=`ls|grep [A-Z]`
for i in $files
mv $i `echo $i | tr [A-Z] [a-z]`

# Mind the backquotes!!!!

If you put an 'echo' command before the 'mv' command you will see what will actually happen:
echo mv $i `echo $i | tr [A-Z] [a-z]`


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple question about sed or awk setianusa Programming 2 09-16-2005 04:57 PM
Simple bash/awk/sed scripting question R00ts Programming 4 04-16-2005 03:55 AM
awk and sed issues alaios Linux - General 11 03-24-2005 06:33 AM
sed or awk help requested tonyfreeman Programming 7 10-03-2004 01:23 AM
awk/sed help pantera Programming 1 05-14-2004 12:59 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration