bug-findutils
[Top][All Lists]
Advanced

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

Re: find -ok ... and reading from stdin


From: Russell Shaw
Subject: Re: find -ok ... and reading from stdin
Date: Mon, 18 Jul 2005 19:10:14 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1

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.




reply via email to

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