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: James Youngman
Subject: Re: find -ok ... and reading from stdin
Date: Mon, 18 Jul 2005 09:39:36 +0100
User-agent: Mutt/1.5.9i

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).

Regards,
James.




reply via email to

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