Hi All,
My problem is calling a function and if my function is correct.
Firstly I read a file for e.g.
(011111111 20040814092402 2222222 1 1140 tedo:04 df23 403866 )
use $6,$7,$8,(*/*/*tedo:04.df23*403866*), search for that file (getline) and then call a tool which reads the file. Using the for loop, search for that NUM and result will be printed out.
awk -v Sea=a_num -v NUM=$2'
function get_f_name(file) {
e_a="NumberReceived]5"
e_b="NumberReceived]5"
cmd="/sbin/ls -rt " 'SEA'
cmd | getline FILE;close(cmd);
{if (system("/sbin/ls -rt " SEA " 2>/dev/null" ) ==0) {
tool=(system("which TOOL "))
#How would one be able to call the TOOL for eg
TOOL FILE | use the for loop
{for(e=1;e<NF;e++){
{if (($e~/'$e_a'/ && ($(e-1)~/'NUM')'/)))
{ print $0;next}
}else{
print "Chris FAILED"
}
}
}
{if ($0~/[a-z,+]:/){
SEA="*/*/*"$6"."$7"*"$8"*"
printf "%15s %15s %15s %15s %15s %s\n",$1,$2,$3,$4,$5/10,SEA
}
if(Sea="a_num"){
get_f_name()
}
else
{if (Sea="b_num"){
#call the next function
}
}
}
}' Chris_num
Many Thanks
Chris
My problem is calling a function and if my function is correct.
Firstly I read a file for e.g.
(011111111 20040814092402 2222222 1 1140 tedo:04 df23 403866 )
use $6,$7,$8,(*/*/*tedo:04.df23*403866*), search for that file (getline) and then call a tool which reads the file. Using the for loop, search for that NUM and result will be printed out.
awk -v Sea=a_num -v NUM=$2'
function get_f_name(file) {
e_a="NumberReceived]5"
e_b="NumberReceived]5"
cmd="/sbin/ls -rt " 'SEA'
cmd | getline FILE;close(cmd);
{if (system("/sbin/ls -rt " SEA " 2>/dev/null" ) ==0) {
tool=(system("which TOOL "))
#How would one be able to call the TOOL for eg
TOOL FILE | use the for loop
{for(e=1;e<NF;e++){
{if (($e~/'$e_a'/ && ($(e-1)~/'NUM')'/)))
{ print $0;next}
}else{
print "Chris FAILED"
}
}
}
{if ($0~/[a-z,+]:/){
SEA="*/*/*"$6"."$7"*"$8"*"
printf "%15s %15s %15s %15s %15s %s\n",$1,$2,$3,$4,$5/10,SEA
}
if(Sea="a_num"){
get_f_name()
}
else
{if (Sea="b_num"){
#call the next function
}
}
}
}' Chris_num
Many Thanks
Chris