Skip to content

interp: interprets select incorrectly #969

Closed

Description

@Zebradil

The following example shows differences between bash and gosh in interpreting select operator:

$ gosh -c 'select SEL in foo bar baz; do echo "Selected $SEL"; break; done'
Selected foo
$ bash -c 'select SEL in foo bar baz; do echo "Selected $SEL"; break; done'
1) foo
2) bar
3) baz
#? 3
Selected baz

gosh selects the first option without prompt, bash prompts for option selection and correctly assigns the selected value.

Activity

  1. changed the title [-]gosh interprets `select` incorrectly[/-] [+]interp: interprets `select` incorrectly[/+] on Feb 3, 2023
  2. mvdan commented on Feb 3, 2023

    @mvdan
    Owner

    Thanks for reporting; the parser supports this, but the interpreter incorrectly handles it like a for.

  3. self-assigned this
    on Feb 14, 2023
  4. added a commit that references this issue on Feb 25, 2023
    450d401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址