Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, for commands, the input/output redirections can precede them, but for some reason it doesn't work for builtin constructs like `while`:

    $ < <( echo foo ) while read -r f; do echo "$f"; done
    -bash: syntax error near unexpected token `do'
    $ < <( echo foo ) xargs echo
    foo

    $ bash --version
    GNU bash, version 5.1.4(1)-release (x86_64-apple-darwin20.2.0)



Maybe wrap the loop either with parentheses or braces?


Tried that, but nope :D I'll let you figure this one out once you get near a computer!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: