![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| c shell script help with find | bigboizvince | Shell Programming and Scripting | 1 | 03-25-2008 03:49 PM |
| How to embed shell script in a awk code | rajbal | Shell Programming and Scripting | 8 | 09-28-2006 05:19 PM |
| Capture Oracle return code in shell script | Vikas Sood | Shell Programming and Scripting | 1 | 05-22-2006 06:32 PM |
| Store return code of shell script in oracle table | sveera | Shell Programming and Scripting | 3 | 05-04-2005 02:25 PM |
| Hide code in shell script??? | alan | Shell Programming and Scripting | 11 | 08-02-2003 12:33 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Can anyone find a bug in this code?? shell script
I have done a script and IT WORKS JUST PERFECT from command line...but in cron it has problems executing... Code:
nawk -F"|" '
{ s=substr($104,2,18)}
{b[s] ++s}
END { for (i in b) print i, b[i] } ' $1 > /path/to/files/TranId_w$2
q=`cat /path/to/files/TranId_w$2 | wc -l`
echo $q > /path/to/files/forME
nawk -F"|" -v x=$2 -v w=$(cat forME) '
{u=u+1; l=l+$66}
($66 != 0)&&($110 == 1)&&($111 == 0) { a=a+1; s=s+$66}
END { print x"|"u"|"l"|"w"|"s } ' $1 >> statistic
rm /path/to/files/TranId_w$2
rm forME
./ftp_PC statistic
and I execute it ./script1 file1 20061212 I think problem is somewhere in second nawk..becouse in cron I can see TranId_w$2 created every day but statistic is not updated.. can anyone help me with debug?? regards, Last edited by blowtorch; 09-19-2006 at 03:12 AM.. Reason: add code tags |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|