Hi,
can anybody help me please?
I have the following code:
. . .
VARIABLE=sometext
. . .
var="abcd t1-$VARIABLE-t3 -eq 0 && xyz t1-t2-t3 -lt 8"
. . .
I need to have
newvar="t1-sometext-t3 -eq 0 && xyz t1-t2-t3 -lt 8"
I attempted to do it in the following way:
newvar=`echo $var | awk ' { m=split($0,Arr,"rcd") } END { print Arr[2] }'`
It works in command line but does not work in ksh script.
All my efforts to do it via eval were not successful.
Can you please help me with it?
Thanks in advance.
Anta
can anybody help me please?
I have the following code:
. . .
VARIABLE=sometext
. . .
var="abcd t1-$VARIABLE-t3 -eq 0 && xyz t1-t2-t3 -lt 8"
. . .
I need to have
newvar="t1-sometext-t3 -eq 0 && xyz t1-t2-t3 -lt 8"
I attempted to do it in the following way:
newvar=`echo $var | awk ' { m=split($0,Arr,"rcd") } END { print Arr[2] }'`
It works in command line but does not work in ksh script.
All my efforts to do it via eval were not successful.
Can you please help me with it?
Thanks in advance.
Anta