Skip to content

Redirection with dynamic fd allocation #1292

Description

@trchen1033

brush version

brush 0.4.0

bash version (for comparison)

GNU bash, version 5.3.9(1)-release

Platform / OS

Linux

Steps to reproduce

{f}>&1 echo hello >&$f

Actual behavior (brush)

error: invalid redirection target

Expected behavior

hello

Additional context

As described in https://www.gnu.org/software/bash/manual/html_node/Redirections.html#Redirections

If {varname} were in place of a number before a redirection operator, bash find the next available fd >= 10 and store it in varname. Similarly, to close a dynamic fd, place {varname} before a close operator, i.e. {varname}>&-.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: compatRelated to compatibility with standard shellsbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions