Hi all,
any help would be very appreciated, cause I got stuck.
In my (bash) shell script, the string named "energy" has the value "double energy = 100;" (which is printed out correctly on the screen). I am using a shell "for" loop, so "100" is one of the possible values of the "i" variable.
I would like to pass the string "en" to the awk command below.
---
en=${base}${i}${end}
echo $en
awk 'NR==21{$0="en" }1' routInt.h > routInt.temp
---
in routInt.temp at line 21, it writes the letters "en" cause I don't know how to pass to awk the value of the string "en"... Can you help me?
Thanks in advance,
Martino
any help would be very appreciated, cause I got stuck.
In my (bash) shell script, the string named "energy" has the value "double energy = 100;" (which is printed out correctly on the screen). I am using a shell "for" loop, so "100" is one of the possible values of the "i" variable.
I would like to pass the string "en" to the awk command below.
---
en=${base}${i}${end}
echo $en
awk 'NR==21{$0="en" }1' routInt.h > routInt.temp
---
in routInt.temp at line 21, it writes the letters "en" cause I don't know how to pass to awk the value of the string "en"... Can you help me?
Thanks in advance,
Martino