James Youngman wrote:
On Mon, Jul 18, 2005 at 11:37:19AM +1000, Russell Shaw wrote:

I haven't used the -ok feature, so this is only my guess of what
should happen.

If find is fed with a pipe for stdin, questions asked by -ok should
open a new file descriptor for the controlling tty. If the process
group is in a session that has no controlling tty, then find should
block or exit on a TTIN/TTOU signal.

This is an interesting idea and straightforward to implement.  Is
there a consensus in favour of this?

It would save scripts being accidently run by batch jobs that would
normally ask questions about doing large deletions. If the user
intended that, they should edit out the -ok command.

Indeed.

The other way is to have an extra option that tells find to assume
yes or no for -ok when run without access to a controlling
tty. Maybe -nok for assume "no" and -yok to assume "yes".

Well, -yok would just be -exec and -nok would just be -false (with the
arguments removed).

I was just thinking of scripts that would be dual use so that they can
be run interactively as well as in sessions with no tty. I don't know if
it would be used much in practice.


_______________________________________________
Bug-findutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-findutils

Reply via email to