Hi All!!
The below command is working fine in command prompt and shell script.But in Perl the substring along with the awk is getting overridden by the functionality of perl subsrting .
Because of which the $0 parameter in awk substring which was supposed to be interpreted as entire line from previous command is recognized as the file name of my perl script.
I can write a perl script instead of this which would solve this issue.
But i am quite curious to know about this odd behaviour.
Command
grep 050031634042163059 siritest | grep 200906011 | cut -c2-19,205-224 | awk '{ print "05 " substr($0,1,8) " " substr($0
,9,10) " " substr($0,19,10) " " substr($0,29,10) }'| awk '{ market=$1+0; account=$2+0;mobile=$3+0; noofaircalls++; airmins+=$4
; aircharge+=$5;} END {print market,account,mobile,noofaircalls,airmins,aircharge;}'
Please let me know if there is any other workaround if not substr in this case.
Thanks in advance,
Siri Chennupati