Re: edit multiple files under multiple directories/folders

2010-11-27 Thread Javier Barroso
On Sat, Nov 27, 2010 at 3:43 AM, Kaushal Shriyan wrote: > Hi, > In my home folder I have 6 tomcat directories under > /home/kaushal/tomcat0..6 > Under each of these tomcats there are sub folder conf and inside these conf > there is a file by the name server.xml so for example I have > tomcat0,

Re: edit multiple files under multiple directories/folders

2010-11-26 Thread Ricardo Ramírez
Hi, maybe something like this: PORT=8079;for i in $(find . -iname "server.xml"|sort); do let PORT=$PORT+1; echo $PORT > $i; done or this: PORT=8079;for i in $(find . -iname "server.xml"|sort); do let PORT=$PORT+1; sed -i -e "s/actualPort/$PORT/g" $i; done best regards. 2010/11/26 Kaushal Shriy

edit multiple files under multiple directories/folders

2010-11-26 Thread Kaushal Shriyan
Hi, In my home folder I have 6 tomcat directories under /home/kaushal/tomcat0..6 Under each of these tomcats there are sub folder conf and inside these conf there is a file by the name server.xml so for example I have tomcat0,tomcat1,tomcat2,tomcat3,tomcat4,tomcat5 so i need to edit server.xm