@prologic (#ipbjj5q) I run my 'local' commands over SSH also? I remember researching this, also did some research now, seems that you can only do this with bash or something like this I guess with temp files?
t
```
f() {
uname
}
```
t2
```
#!/bin/sh
. ./t
f
ssh -T adi@REMOTE << EOF
$(cat t)
f
EOF
```
matched #6jlxlhq score:12.09
Search by:
Search by 1 mentions:
(#ipbjj5q) @adi Why does this nor work locally? ๐ค
foo:
```
$ cat foo
foo() { printf "Hello World" }
```
And:
```
$ /bin/sh -c '$(cat foo); foo'
/bin/sh: foo(): command not found
/bin/sh: foo: command not found
```
matched #5id23qa score:12.09
Search by:
Search by 1 mentions:
(#ipbjj5q) @prologic (#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.```
matched #uk2yfha score:12.09
Search by:
Search by 1 mentions: