shell script to take input from user , a list of directory path into file and enter each directory make changes to file
by sandeep.c from LinuxQuestions.org on (#58Q59)
Requirement---URGENT for production server----------please check for my syntaxes if possible-------------
echo path
cat >> path.txt
/app/tomcat7/webapps/sessionchecking.class ----- directory paths may increase in size or number ------
/app1/tomcat1/webapps1/Home.jsp
/app2/tomcat2/webapps2/struts.xml
ctrl-d
cat path.txt | while read line
do
pathvariable="$line"
base=$(basename ($pathvariable))
dir=$(dirname ($pathvariable))
echo $base
echo $dir
cd "$dir" -------------need to clear the contents of dir after processing -----------
mv $base /Contexts/backup
scp 10.3.x.x:/root/Downloads/sessionchecking.class .
done


echo path
cat >> path.txt
/app/tomcat7/webapps/sessionchecking.class ----- directory paths may increase in size or number ------
/app1/tomcat1/webapps1/Home.jsp
/app2/tomcat2/webapps2/struts.xml
ctrl-d
cat path.txt | while read line
do
pathvariable="$line"
base=$(basename ($pathvariable))
dir=$(dirname ($pathvariable))
echo $base
echo $dir
cd "$dir" -------------need to clear the contents of dir after processing -----------
mv $base /Contexts/backup
scp 10.3.x.x:/root/Downloads/sessionchecking.class .
done