Sujet : Re: Problem with 'rm -i' in ksh
De : Lem (at) *nospam* none.invalid (Lem Novantotto)
Groupes : comp.unix.shellDate : 12. Jan 2025, 12:05:53
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vm07mh$13cnk$5@dont-email.me>
References : 1 2 3
User-Agent : Pan/0.160 (Toresk; )
Il Sat, 11 Jan 2025 15:07:05 +0100, Janis Papanagnou ha scritto:
Yes, just these commands in a script work also in my environment. (That
was what I meant when I wrote: "constructing a test sample from
scratch";
it didn't lead me anywhere, since it just wasn't reproducible in a
primitive context like that.)
I think it must have to do with the shell environment that in some way
affects how 'rm -i' behaves. But I have no idea how an external
(shell-environment-)condition could look like that makes an executed
program like 'rm' behave as if all '-i' confirmations are "magically"
considered as being each answered by "no" (without me typing anything).
Oh, I'm sorry for my mistake.
Letting alone the redirection of standard input, or the "cron or whatever"
hypothesis, that didn't seem to fit your situation, and since the command
works well itself in a primitive context, it seem strange to me that the
cause can be found in your ksh configuration, too...
So, I can't think of anything... which doesn't impress me much: it happens
frequently. ;)
However: if you add in the script "< /dev/tty" as in
rm -i file < /dev/tty
does it make any change?
rm -i is called in a pipe? Exec? Subshell?
I know you know. I'm out of ideas.
-- Bye, Lem Talis erit dies qualem egeris