I got this new error message: I have full permission on the file.
awksatya.ksh[2]: dev: not found
./awksatya.ksh[5]: dev: not found
./awksatya.ksh[7]: date+%Y%m%d: not found
awk: Cannot find or open file CARE01_DLY_???_.
The source line number is 1.
Here is the code:
awksatya.ksh
Code:
#!/bin/ksh
dev = /biddf/ab6498/dev/ctl
export dev
cd dev
awk '{data[FNR] = $0; out=FILENAME "_new"; file[FNR]=out;} END { if (
FNR - 2 == $1) { for ( i=2 ; i < FNR; i++ ) { print data[i] > file[i]}
close(file[i])}else { print "error"} }' CARE01_DLY_???_`date+%Y%m%d`
Last edited by reborg; 07-20-2006 at 09:06 PM..
Reason: code tags
You guys are simply superb man. I bow to your UNIX skills and the integrity in which you are maintaining the site. I really appreciate your knowledge and skill set.
One more thing Reborg/Vgresh,
I am getting an error
awk: Cannot find or open file CARE01_DLY_???_20060720. I think its not taking the MKT characters in the file.
I have the file CARE01_DLY_MKT_20060720 in the directory /biddf/ab6498/dev/ctl But I don't know why this is showing as
CARE01_DLY_???_20060720. Does the pattern substitution not working in our code. Kindly suggest guys. We are almost there. Just one step away.