View Single Post
Old Jan 31st, 2008, 12:52 AM   #1
sons_of_bitch
Newbie
 
Join Date: Jan 2008
Posts: 2
Rep Power: 0 sons_of_bitch is on a distinguished road
scripting question

hi all,

i'm new here, i would like to add on the print command to prompt user to enter a value and store inside the variable name as $inName like
print "what is your directory : ";
then the answer is storing to &inName

after that the value will replace the existing line for ${METRICA_DIR}/TechnologyPacks/Spool/2030324032
i'm new in scripting, could anyone give me some hint for sripting?

tmpfile=/tmp/tmpfile.$$

for file in loaderconfiguration*.xml
do
sed "s|${METRICA_DIR}/TechnologyPacks/Spool/2030324032|$inName|g" $file > $tmpfile
mv $tmpfile $file
done

thanks
sons_of_bitch is offline   Reply With Quote