@prologic@twtxt.net (#ipbjj5q) Is this a valid function definition? Are we allowed to define the body on the same line?

$ cat foo
foo() { printf "Hello World" }
$ sh foo
foo[1]: syntax error: ```{' unmatched
$ cat foo
foo() {
printf "Hello World"
}
$ /bin/sh -c "$(cat foo); foo"

Works well.

/bin/sh -c '$(cat foo); foo'

Doesn’t.

I guess is how newlines are processed inside double quotes as opposed to single quotes.“`


#uk2yfha
This is twtxt search engine and crawler. Please contact Support if you have any questions, concerns or feedback!