Hi Gurus,
I have a command to assign value based on input value.
current condition is
"if pattern matches "case", then assign "HOLD" else "SUCC"
right now, I need to add one more condition (variable name is VAR).
the condition is "
if pattern1 matches "case", then assign "HOLD" else if pattern2 not matches "exp", then SUCC else "IA".
when I try to add second variable and try a simple nested condition
if pattern1 matches "case", then assign "HOLD" else if pattern2 not matches "exp", then SUCC
but the code doesn't work.
$cat file
aaa_case
bbb_xxx
ccc_xxx
ddd_xxx
eee_exp
$/usr/xpg4/bin/awk -v DUMMY="case" -v VAR="exp" 'tolower($0)~DUMMY{print "HOLD", $0} tolower($0)!~DUMMY and $0!~VAR {print "SUCC" ,$0}' OFS="," file
ON_HOLD,aaa_case
SUCCEEDED,aaa_case
SUCCEEDED,bbb_xxx
SUCCEEDED,ccc_xxx
SUCCEEDED,ddd_xxx
SUCCEEDED,eee_exp
Could anybody take a look this below code and let me know where I am wrong.
thanks in advance.