Skip to content

rm: shouldn't prompt when stdin is not interactive #7326

Closed
@jfinkels

Description

@jfinkels

Environment: Ubuntu 24.04, uutils main branch (git commit a2af5d6), GNU coreutils v9.6.19-7386c-modified

Steps to reproduce:

mkdir -m0 dir
rm -d dir < /dev/null

What happens now: uutils rm prints the interactive prompt but immediately terminates, and leaves the directory as-is:

rm: attempt removal of inaccessible directory 'inacc2'?

What I expected to happen: GNU rm prints nothing and removes the directory silently.

Notes: this is causing a failure in GNU test file tests/rm/empty-inacc.sh. I guess the logic here is that if stdin is not an interactive terminal, then the prompting is disabled? I'm not sure.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions