help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Am I doing it all wrong?


From: (
Subject: Re: Am I doing it all wrong?
Date: Sun, 28 Aug 2022 13:21:22 +0100

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. :)

    -- (



reply via email to

[Prev in Thread] Current Thread [Next in Thread]