Noop ???


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Noop ???
# 1  
Old 03-03-2006
Noop ???

Hi all,

Here is the statement

====
If InCallFlag = ‘Y'
if (input:LanId != ‘') TempLanId = input:LanId
if (input:Location != ‘') TempLocation = input:Location
if (input:ANI != ‘') TempANI = input:ANI
if (input:Extension != ‘') TempExtension = input:Extension
if (input:CallLength != ‘') TempCallLength = input:CallLength
If ( input:Action != ‘CTI-CallTimer') WriteFlag = ‘Y'
if (input:Action contains ‘Modify')
type = extract data from beginning of input:Action stopping at ‘Modify '
mainkey = extract data from input:Action starting after ‘Modify ' and continuing until the next space.
searchspec1 = type mainkey
searchspec2 = type ‘Modify ‘ mainkey
searchspec3 = type ‘Access ‘ mainkey
if (TempCallAction contains searchspec1 or TempCallAction contains seatchspec2)
noop
else if (TempCallAction contains searchspec3)

find entry in TempCallAction that contains searchspec3 and remove it from TempCallAction
<--- I am lost
TempCallAction = TempCallAction ‘|' input:Action
else
TempCallAction = TempCallAction ‘|' input:Action
else if (input:Action contains ‘Access')
type = extract data from beginning of input:Action stopping at ‘Access '
mainkey = extract data from input:Action starting after ‘Access ' and continuing until the next space.
searchspec1 = type mainkey
searchspec2 = type ‘Modify ‘ mainkey
searchspec3 = type ‘Access ‘ mainkey
if (TempCallAction contains searchspec1 or TempCallAction contains seatchspec2 or TempCallAction contains searchspec3)
noop
else
TempCallAction = TempCallAction ‘|' input:Action

Here is the code I wrote in Korn shell

if (InCallFlag == "Y") {
if (id != " ") {
TempLanId = $1;
}
if (location != " ") {
TempLocation = $3;
}
if (ani != " ") {
TempANI = $4;
}
if (ext != " ") {
TempExtension = $5;
}
if (calllength != " ") {
TempCallLength = $6;
}
if (action != "CTI-CallTimer") {
WriteFlag = "Y";
}
if (action ~ /Modify/) {
type = substr(action,1,index(action,"Modify")-2);
mainkey = substr(action,index(action,"Modify")+7,index(substr(action,index(action,"Modify")+7,20)," ")-1);
searchspec1 = type mainkey;
searchspec2 = type "Modify " mainkey;
searchspec3 = type "Access " mainkey;
}
if (TempCallAction ~ /"$searchspec3"/) {
## NOOP ??
## TempCallAction = TempCallAction "|" action;

}
else {
TempCallAction = TempCallAction "|" action;
}
fi
}


elif (action ~ /Access/) {
type = substr(action,1,index(action,"Access")-2);
mainkey = substr(action,index(action,"Access")+7,index(substr(action,index(action,"Access")+7,20)," "));
searchspec1 = type mainkey;
searchspec2 = type "Modify " mainkey;
searchspec3 = type "Access " mainkey;
}
if ((TempCallAction ~ /"$searchspec1"/) || (TempCallAction ~ /"$searchspec2"/) || (TempCallAction ~ /"$searchspec3"/)){
## NOOP ??
## TempCallAction = TempCallAction "|" action;

}
else {
TempCallAction = TempCallAction "|" action;
}
fi
}
}


What is NOOP ? and how you write it in Korn shell ?
Thanks for your advice.
# 2  
Old 03-03-2006
Typically mean no operation.

KSH version is ":"

example:

:
# 3  
Old 03-03-2006
it does not look like a ksh code..... reminds me of some perverted mix of awk and ksh!
# 4  
Old 03-03-2006
It seems as though the OP is migrating a script to KSH and wants to replicate every line in KSH syntax.
# 5  
Old 03-03-2006
Yes, this code is in my awk statement . I search google and see they put : for Noop too, but i am not sure Smilie

And how about this, how do you do it ?

else if (TempCallAction contains searchspec3)

find entry in TempCallAction that contains searchspec3 and remove it from TempCallAction
<--- I am lost
TempCallAction = TempCallAction ‘|' input:Action

Please advice Smilie
# 6  
Old 03-03-2006
Quote:
Originally Posted by sabercats
Yes, this code is in my awk statement . I search google and see they put : for Noop too, but i am not sure Smilie

And how about this, how do you do it ?

else if (TempCallAction contains searchspec3)

find entry in TempCallAction that contains searchspec3 and remove it from TempCallAction
<--- I am lost
TempCallAction = TempCallAction ‘|' input:Action

Please advice Smilie
what IS your 'TempCallAction' - scalar, array, string with separators?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

noop option kernel

hi guys I have Suse 10 and Suse 11 and I need to add the option elevator=noop Suse 11 kernel /boot/vmlinuz-2.6.27.29-0.1-pae root=/dev/sda1 resume=/dev/sda2 splash=silent showopts vga=0x32b elevator=noop Suse 10 kernel /boot/vmlinuz-2.6.16.60-0.54.5-smp root=/dev/sda1 vga=0x32b ... (0 Replies)
Discussion started by: kopper
0 Replies
Login or Register to Ask a Question