On Sun Aug 28, 2022 at 12:50 PM BST, Csepp wrote:
> Did you test that one? Because I'm pretty sure it won't work, you
> aren't passing the heredoc file descriptor to sh but guix shell.
I hadn't tested it then, but I just did now, and it works.
gsh -D guix lua <<EOF
echo "hello"
lua -e 'print "hello"'
guile -c '(display "hello") (newline)'
EOF
hello
hello
hello
> Also, that should probably be "$@", just in case.
I don't think it'll make any difference; if, say, "foo" "bar" "baz" is
passed, both $@ and "$@" will expand to "foo" "bar" "baz" (yes, bypassing
the quotes).
According to POSIX.1-2017's specification of `sh`:
When the expansion occurs within double-quotes, the behavior is unspecified
unless one of the following is true:
+ Field splitting [...] would be performed if the expansion were not within
double-quotes [...].
+ [...]
So, $@ == "$@".
> Because Bash is garbage. :)
I can't disagree on that one. :)
-- (