Hi PHV,Futurelet or All
How can I call a function from the example given below.
T_S is the unix timestamp (eg 073810000 ,1073810002..).
What I would like to do is whenever the variable T_S is assigned, I would pass it to the function, which inturn convert it to date format (function Time_S )and then printf out.
Time_S(){
echo "0d$1=Y"|adb |sed -e 's/://g'| awk '
BEGIN{OFS=""}
{$2=(index("JanFebMarAprMayJunJulAugSepOctNovDec",$2)-1)/3+1
if($2<10)$2="0"$2
if($3<10)$3="0"$3
print
}'
}
cat FILE | awk '{for (e=1;e<=NF;e++){if (match($e,"CHRIS")){if($82!="V"){st=$85}{if($154=="M"){T_S=$155}{printf "%s %15.f",st,T_S}}}}'
Many Thanks
Chris
How can I call a function from the example given below.
T_S is the unix timestamp (eg 073810000 ,1073810002..).
What I would like to do is whenever the variable T_S is assigned, I would pass it to the function, which inturn convert it to date format (function Time_S )and then printf out.
Time_S(){
echo "0d$1=Y"|adb |sed -e 's/://g'| awk '
BEGIN{OFS=""}
{$2=(index("JanFebMarAprMayJunJulAugSepOctNovDec",$2)-1)/3+1
if($2<10)$2="0"$2
if($3<10)$3="0"$3
}'
}
cat FILE | awk '{for (e=1;e<=NF;e++){if (match($e,"CHRIS")){if($82!="V"){st=$85}{if($154=="M"){T_S=$155}{printf "%s %15.f",st,T_S}}}}'
Many Thanks
Chris