Deutsch   English   Français   Italiano  
<vlttua$la3m$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.unix.shell
Subject: Re: Problem with 'rm -i' in ksh
Date: Sat, 11 Jan 2025 15:07:05 +0100
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <vlttua$la3m$1@dont-email.me>
References: <vlsqmt$fem4$1@dont-email.me> <vltjc3$htgh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 11 Jan 2025 15:07:06 +0100 (CET)
Injection-Info: dont-email.me; posting-host="a1644839a0307c2f39264ce2a86c076e";
	logging-data="698486"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/MpZJIQ/KHksQ6+/M/sawf"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
Cancel-Lock: sha1:zTq650VCy2f36ixBoyEMfZkVH4c=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <vltjc3$htgh$1@dont-email.me>
Bytes: 2877

On 11.01.2025 12:06, Lem Novantotto wrote:
> Il Sat, 11 Jan 2025 05:05:48 +0100, Janis Papanagnou ha scritto:
> 
>> Does that effect - interaction of rm -i behavior with non-interactive
>> ksh, flushing the confirmation messages! - sound familiar to anybody?
>>
>> (I get the same behavior with 'ksh 93u' and 'ksh 93u+m', BTW.)
> 
> Uhmmm... here it works. But maybe I'm missing something...

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

Janis

> 
>> 11:59:35<lem@biggy:/tmp/prova$ cat mioscript
> #!/bin/ksh
> unset f_names
> typeset -A f_names
> f_names["file1"]=
> f_names["file2"]=
> f_names["file3 3"]=
> echo "${!f_names[@]}"
> rm -i "${!f_names[@]}"
>> 11:59:43<lem@biggy:/tmp/prova$ ./mioscript
> file1 file2 file3 3
> rm: rimuovere file regolare vuoto 'file1'? n  
> rm: rimuovere file regolare vuoto 'file2'? n
> rm: rimuovere file regolare vuoto 'file3 3'? n
>> 12:00:28<lem@biggy:/tmp/prova$ ksh ./mioscript
> file1 file2 file3 3
> rm: rimuovere file regolare vuoto 'file1'? n
> rm: rimuovere file regolare vuoto 'file2'? n
> rm: rimuovere file regolare vuoto 'file3 3'? n
>> 12:00:38<lem@biggy:/tmp/prova$ ksh --version
>   version         sh (AT&T Research) 93u+m/1.0.8 2024-01-01
>