Skip to content

How does read builtin survive the pipe stdin redirection? #6

@Babagilo

Description

@Babagilo

Hi, guys,

I tried to add some interactivity to allow user to abort or continue an operation by using the read command which is similar to below existing statement:

read -p "Do you want to prune (permanently delete) all the orphaned node instances? (N/y): " -n 1 -r

But the problem is that if the treetool is running alone, the read builtin will prompt the user as expected, but when it is piped with another treetool command, then the prompt is not happening.

I guess it's because read by default only prompts to stdin, but when the redirection pipe happens, something happened and such user interface is suppressed. But I don't know how to fix it.

Please advise.

Regards,
Babagilo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions