[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proposal: find -quit
From: |
Dan Jacobson |
Subject: |
Re: proposal: find -quit |
Date: |
Sun, 15 Jun 2003 11:25:45 +0800 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu) |
>> $ find tree -newer timestamp -exec sound_the_alarm \; -quit
James> ...sound_the_alarm could kill its parent...
OK, then
>> $ find tree -newer timestamp -print -quit
"All I need is one filename to prove Larry had been tampering"
Indeed, find(1) is like what 30 years old, and they never thought of a
simple -quit [implemented with just a exit() or whatever it is in C.
Ah, nice to have my Limited Edition brain.
Anyways, maybe call it -exit, and allow the user to give an optional
exit value, for extra flexibility!
Wait, maybe have a -exitvalue that will set find's exit value, but not
necessarily exit. Then the user could use
find ... -exitvalue 33 ... -o ... -exitvalue 44 ... -exit ...
in all kinds of interesting and varying ways to get maximum
flexibility. When -exit is encountered, find exits with 0 or the
value it found it its last encounter with -exitvalue, if any.
Of course if there is a disk error or something, then find can exit
with its traditional exit value.
If worthy, do encode my ideas.
--
http://jidanni.org/ Taiwan(04)25854780