[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
specify a multiple of m arguments in xargs
From: |
Peng Yu |
Subject: |
specify a multiple of m arguments in xargs |
Date: |
Thu, 20 Feb 2020 13:46:40 -0600 |
Hi,
xargs by default does not put a multiple of m arguments (m is an
integer greater than 1) to the command line. But is there a way that I
can make sure only a multiple of m arguments are put the command line.
For example, for something like the following command, I'd like to
make sure everytime there are 5 m arguments given to printf. But I
don't think xargs can guarantee so by default in the output of the
example.
$ seq 1000000 | xargs printf '%s\t%s\t%s\t%s\t%s\n' > /tmp/1.txt
$ < /tmp/1.txt awk -v FS='\t' -e '!($1 && $2 && $3 && $4 && $5)' | wc -l
105
--
Regards,
Peng
- specify a multiple of m arguments in xargs,
Peng Yu <=