Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Too many Output Files"

Status
Not open for further replies.

sergio2003

Technical User
Nov 4, 2003
32
0
0
CL
Hello Brothers:

Y Have the next script ( ksh - Solaris):



#!/usr/bin/ksh

/usr/bin/cat /home/peri/Sergio/Mosaix/account.20040916 | /usr/bin/grep "/dev/pts/" | /usr/bin/awk '

BEGIN { FS = "/" }

{ a = 1
b = substr($6,a,a)

while ( b != "!" )
{
a = a+1
b = substr($6,a,1)

}
d = a -1
c = substr($6,1,d)
open ( c )
print $0 >> c
close ( c )

} '


BUT I get the next error "awk :Too many output files 10"
My idea is read a file (account.20040916 ) and create new files with some segments got from the account.20040916 file.

Any idea my friends?

Thanks in advance.

Sergio
 
Get rid of the unneeded open(c) statement.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV, but Culd yo give some example please?

Thanks in advance.

 
c = substr($6,1,d)
[highlight]#[/highlight] open ( c )
print $0 >> c
close ( c )


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I dit it, but I have the same error, Do you have any other Idea please?


Thanks

Sergio
 
Don't you have the xpg4 version of awk in Solaris ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks,
1.- Where can I find and Download the xpg4?
2.- How can I see the version of the awk?
3.- Can I also install the XPG4 in a HP-UNIX?

Thanks in advance.

Sergio
 
if on Solaris, try using nawk instead of awk.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks vgersh99, All Its Ok NOw, bun after it I have to traslate this program to a HP- Unix, Culd I also use the nawk in Hp -UNix?

Thanks


Sergio
 
if there is on - I don't have HP-UX handy here - you'll have to try and see.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top