I'm very new to unix.. so i need help on getting the following output..
I ve to take two values from a parm file.. then update one of those values by adding 1 to it.. and finally concatenate both the values to get the output..
I hope awk is not in the requirement as this is already doable without it and much simpler:
SOURCE="filename.parm"
# get value of RUN_ID
RUN_ID=`grep ^RUN_ID $SOURCE | cut -d= -f2`
# get value of ver_num
ver_num=`grep ^ver_num $SOURCE | cut -d= -f2`
RUN_ID=$((RUN_ID + 1))
echo $ver_num$RUN_ID
The awk command in your code is printing version and run_id in seperate lines. So the read command cannot get these values into two variables(it will work only if both values are in the same line). You may use the following: