hello,
have a file that i would like to replace the value in the third position (file is comma separated) with a value in a table. the value in the table begins with a " and ends in a ". the sed command to replace does not work.
numofrows=`wc -l tempfile.tmp`
for i in $numofrows
do
thirdvalue=$(awk -F"," '{print $3}' tempfile.tmp )
eval tablename=\$table_${thirdvalue}
sed 's/"$thirdvalue"/"$tablename"/g' < tempfile.tmp > newtempfile.tmp
done
table is this
table_value1="bb=value12,cc=value13"
table_value2="hh=value24,cc=value13"
at the beginning of the script i have this to determine the server and table to use.
hostname=`uname -n`
case $hostname
in
servername ). /temp/tablename.sh;;
esac
Thanks in advance for the help
Also sample data for this table:
What do you mean by "determine the server and table to use"? Use for what?
:p