Hi All,
What will be the best way to solve this problem, as stipulated below (max 2042 files).
awk: Cannot open file /dm/tool//TimePrint 2004/05/21 03:07:41 | grep Local | cut -f3 -d" " .
A maximum of 2042 files can be open at one time.
The input line number is 2043. The file is 21-MAY-04Chris
My script
if [[ ! -f $file ]];then
echo "No file to process"
fi
awk -F " " '{
split($1,a,".")
S=a[1]
type=a[2]
D=a[3]
T=a[4]
D_T=$5" "$6
VOL="/trans/Arch_logs/"$3".txt"
cmd="/dm/tool//TimePrint " D_T " | grep Local " "| cut -f3 -d\" \" "
cmd | getline TIME; close(cmd);
printf "bmed %s %s %s %s \" \" %s Arch Arch %s %s Arch %s Success \" \" /raw/arch/\n",T,S,type,D,$1,Date,TIME,$3 > $1
system("/usr/bin/chmod 777 " $1)
{if (system("./"$1 ">>" VOL) != 0) {
system("/dm/tool/.send_alarm " "f + "$1" \" \" 15002 9 \""$1" not updated in Arch\" ")
printf("Failed!!! %s\n",$1);
} else {
system("/sbin/rm " $1)
printf("Done. %s\n",$1)}}
}' $file
What will be the best way to solve this problem, as stipulated below (max 2042 files).
awk: Cannot open file /dm/tool//TimePrint 2004/05/21 03:07:41 | grep Local | cut -f3 -d" " .
A maximum of 2042 files can be open at one time.
The input line number is 2043. The file is 21-MAY-04Chris
My script
if [[ ! -f $file ]];then
echo "No file to process"
fi
awk -F " " '{
split($1,a,".")
S=a[1]
type=a[2]
D=a[3]
T=a[4]
D_T=$5" "$6
VOL="/trans/Arch_logs/"$3".txt"
cmd="/dm/tool//TimePrint " D_T " | grep Local " "| cut -f3 -d\" \" "
cmd | getline TIME; close(cmd);
printf "bmed %s %s %s %s \" \" %s Arch Arch %s %s Arch %s Success \" \" /raw/arch/\n",T,S,type,D,$1,Date,TIME,$3 > $1
system("/usr/bin/chmod 777 " $1)
{if (system("./"$1 ">>" VOL) != 0) {
system("/dm/tool/.send_alarm " "f + "$1" \" \" 15002 9 \""$1" not updated in Arch\" ")
printf("Failed!!! %s\n",$1);
} else {
system("/sbin/rm " $1)
printf("Done. %s\n",$1)}}
}' $file