[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Wed, 13 Feb 2008 14:56:19 -0600
I googled a bit and it see this problem asked several times, but I
never really saw a slick solution:
set -o pipefail
find / -type f -print 2>&1 |head -20
find fails because it has a bunch of output, but head only will accept
the first n lines.
This is a problem for me because I have trap ERR & errexit & pipefail activated.
The solution I will use will be to write the find output to a file,
then run head on it.
I am hoping that someone on the group has a more graceful solution.
BTW: I am not using find in my real script. I just used that here so
anyone could reproduce the problem.
- broken pipe,
Michael Potter <=