coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: split --filter=CMD: last call


From: Pádraig Brady
Subject: Re: split --filter=CMD: last call
Date: Tue, 03 May 2011 10:12:27 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 03/05/11 09:54, Jim Meyering wrote:
> 
> [PATCH 1/3] split: accept new output --filter=CMD option
> [PATCH 2/3] tests: test split's new --filter=CMD option
> [PATCH 3/3] doc: document split's new --filter=CMD option

I should also play devil's advocate and point
out the existing alternative to split --filter.

# Set filter as required
 filter() { cat $FILE | gzip -c > $FILE.gz; }
#create fifos
 rm -f x??
 split -n3 /dev/null
 for f in x??; do rm $f && mkfifo $f; done
#consumer
 for FILE in x??; do filter& done
#producer
 split -n3 file
#cleanup
 wait
 rm -f x??

The above is sufficiently onerous to make split --filter
a useful option. Though I've a niggling feeling that the
above could be the basis of a contrib helper script.

cheers,
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]