awk questions: >10 output files; RS

Dominic Dunlop domo at riddle.UUCP
Wed Apr 26 05:12:36 AEST 1989


In article <255 at aztec.osbusouth.xerox.COM> hamilton.osbuSouth at Xerox.COM
(Bruce Hamilton) writes:
>
>-how can I get more than ten output files?  [in awk]

Thought this was fixed in nawk.  Or am I wrong?  Anyway, the way to get
around this `feature' of awk is to have awk create a shell script with here
documents, than feed it to a shell.  If you feel ambitious you can have awk
pipe the data itself by putting | "sh" on the end of all the printing
commands, otherwise, just do it in the shell:

	awk -f script input | sh

What awk should be spitting out is something like

	cat << E_O_F >file001
		lines of
		data for
		file001
	E_O_F
	cat << E_O_F >file002
		lines of
		data for
		file002
	E_O_F
	...
	cat << E_O_F >filennn
		lines of
		data for
		filennn
	E_O_F

(Think that's the third time I've posted this in the last few years.  I
must be getting old...)
-- 
Dominic Dunlop
The Standard Answer Ltd., using Sphinx' facilities (for which much thanks)
domo at sphinx.co.uk



More information about the Comp.unix.questions mailing list