Is there a diff way to exec this shell prg??

Hi,

I want to know whether it is possible to to execute the below script like

ksh ds.ksh <input file> > <output file> or any other simple way other then ./

The way i'm executing it right now is

nawk -f ds.ksh <input file> > <output file>.

I need the first format as my ETL tools is not able to understand the nawk -f execution format.Is there any change within the program i need to do ?

#!/usr/bin/nawk -f

BEGIN {
FS=OFS="|"

FLD_max=11

FF=sprintf("\f")

}
$0 ~ FF { gsub(FF, ""); $1=$1 }

(fld + NF-1) > FLD_max {
if (fld == FLD_max)
print rec

}
##NF < FLD_max {printf("Bad record: [%d] :: [%s]\n", FNR, $0) | stderr;
NF < FLD_max {rec=(rec != "") ? rec $0 : $0; fld+=(NF-1);next }
{rec=$0; fld=NF}
END {
if (rec != "" && split(rec, a, FS) >= FLD_max ) print rec

Regards,
Kumar

Rename your file from ds.ksh to ds.awk (optional but recomended)
Make executable your awk script file.
Run your script file.

$ mv dt.ksh dt.awk
$ chmod +rx dt.awk
$ dt.awk infile > outfile

HI Aigles,

Thats the way i was executiong before on the shell prompt.But now i want to call this within the ETL tool.The ETL tool which is use understand the scripts when it is executed like this

ksh or sh <path of script> > <path of log> 2>&1

I want to know whether it is possible to execute the script in the above manner instead of pointing the interpreter to nawk -f execution.

Regards,
Kumar.

ksh -c 'nawk -f dt.ksh infile > outfile'