The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 12-21-2005
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Do you want to move the files too (this is sh/ksh/bash)?


Code:
$ touch mlcl_1 mlcl_2 mlcl_3
$ ls mlcl_*
mlcl_1  mlcl_2  mlcl_3
$ ls | while read file; do
>   mv $file `echo "${file}" | sed 's/mlcl/mll/'`
> done
$ ls
mll_1  mll_2  mll_3
$

Cheers
ZB