pipes and the sort command

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Thu Dec 27 15:10:03 AEST 1984


> 	I am interested in using the popen() command to form a pipe
> 	between my C program and the UNIX sort command. I would appreciate
> 	any information on the best way to do this(examples would help).
> 	I should point out that the input to the sort command would be
> 	comming from an array and the output should be stored in an array.

It is very hard to manage both ends of a piped filter from a program.

Have you considered using the qsort() library routine to sort your data?



More information about the Comp.lang.c mailing list