can you help script about rename directory

Roland Smith rsmith at xs4all.nl
Thu Nov 1 12:35:15 PDT 2007


On Fri, Nov 02, 2007 at 02:20:13AM +0800, adrian kok wrote:
> Hi all 
> 
> how can I have script to rename the following
> directory pattern from
> 
>  
> 
> from 
> 
> dir-192.168.30.0   
> dir-192.168.30.144 
> dir-192.168.30.184
> 
> 
> To:
> 
> dir-10.0.30.0   
> dir-10.0.30.144 
> dir-10.0.30.184
> 
> thank you

for f in dir-192*; do mv $f `echo $f|sed s/192\.168/10\.0/`; done

Roland
-- 
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20071101/e247fd1c/attachment.pgp


More information about the freebsd-questions mailing list