LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-22-2003, 07:12 PM   #1
computera
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, 04:39 AM   #2
arooze
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
do
mv $i `echo $i | tr [A-Z] [a-z]`
done

# 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]`
 
  


Reply



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 03:57 PM
Simple bash/awk/sed scripting question R00ts Programming 4 04-16-2005 02:55 AM
awk and sed issues alaios Linux - General 11 03-24-2005 05:33 AM
sed or awk help requested tonyfreeman Programming 7 10-03-2004 12:23 AM
awk/sed help pantera Programming 1 05-13-2004 11:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:35 AM.

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