The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
foreach loop question
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
foreach loop question
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
6
(
permalink
)
12-21-2005
zazzybob
Registered Geek
Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
My above post was an interactive session, hence the "touch"es.
If you don't want to keep the changes, you can easily do (as long as there aren't a load of files....)
Code:
ls *mlcl* |
sed
's/mlcl/mll/g'
Else; just do
Code:
ls | while read file; do echo "${file}" |
sed
's/mlcl/mll/' done
If you want to keep the filename change, just add in the mv.
Cheers
ZB
zazzybob
View Public Profile
Visit zazzybob's homepage!
Find all posts by zazzybob
Find zazzybob's past nominations received
Find zazzybob's present nominations given