csh is not compatible #316

Closed
opened 2021-11-20 15:24:13 +00:00 by ungleich-gitea · 5 comments

Created by: pestaa

csh is the default shell on FreeBSD 9.0. Although it is supposed to be POSIX-compatible, it does not support

key=value /bin/sh -e command...

syntax and it stops with error

value=key: Command not found.

This issue is easily fixable by changing the default shell even to plain sh, but it is one caveat that might be noted to FreeBSD developers.

*Created by: pestaa* `csh` is the default shell on FreeBSD 9.0. Although it is supposed to be POSIX-compatible, it does not support ``` key=value /bin/sh -e command... ``` syntax and it stops with error ``` value=key: Command not found. ``` This issue is easily fixable by changing the default shell even to plain `sh`, but it is one caveat that might be noted to FreeBSD developers.
Author
Owner

Created by: telmich

Added a permanent entry in the log directory: doc/dev/logs/2012-05-31.csh-compatibilty

*Created by: telmich* Added a permanent entry in the log directory: doc/dev/logs/2012-05-31.csh-compatibilty
Author
Owner

Created by: telmich

cat * | /bin/sh -s could also work, needs testing though

*Created by: telmich* cat \* | /bin/sh -s could also work, needs testing though
Author
Owner

Created by: telmich

Ha!

I've found a solution!

We can setup the variables locally (within a specific context/call) and then send it via the ssh option
"-o SendEnv name"

Do you want to give it a try to implement this in a feature branch?

*Created by: telmich* Ha! I've found a solution! We can setup the variables locally (within a specific context/call) and then send it via the ssh option "-o SendEnv name" Do you want to give it a try to implement this in a feature branch?
Author
Owner

Created by: telmich

Hey Istvan,

Istvan Beregszaszi [Sat, Apr 14, 2012 at 07:59:36AM -0700]:

csh is the default shell on FreeBSD 9.0. Although it is supposed to be POSIX-compatible, it does not support

key=value /bin/sh -e command...

syntax and it stops with error

value=key: Command not found.

Maybe there is even a way to work around this issue:

Maybe we can join / setup the variables inside the /bin/sh call and thus
ignoring whatever shell root is configured for.

Haven't checked the docs (falling almost asleep, but wanted to
write down this comment), but something like this could work:

/bin/sh -e key=value key2=value2 command...

And if not this, the ugly version, creating a file on the remote side
containing

key=value
key2=value2

and the executing the file with /bin/sh would work.

I consider the second approach ugly, but a possible way. I imagine we
could figure some not-so-bad syntax to avoid this.

Cheers,

Nico

PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0

*Created by: telmich* Hey Istvan, Istvan Beregszaszi [Sat, Apr 14, 2012 at 07:59:36AM -0700]: > `csh` is the default shell on FreeBSD 9.0. Although it is supposed to be POSIX-compatible, it does not support > > ``` > key=value /bin/sh -e command... > ``` > > syntax and it stops with error > > ``` > value=key: Command not found. > ``` Maybe there _is_ even a way to work around this issue: Maybe we can join / setup the variables inside the /bin/sh call and thus ignoring whatever shell root is configured for. Haven't checked the docs (falling almost asleep, but wanted to write down this comment), but something like this could work: ``` /bin/sh -e key=value key2=value2 command... ``` And if not this, the ugly version, creating a file on the remote side containing key=value key2=value2 <code> and the executing the file with /bin/sh would work. I consider the second approach ugly, but a possible way. I imagine we could figure some not-so-bad syntax to avoid this. Cheers, ## Nico PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0
Author
Owner

Created by: jdguffey

Indeed. This is an issue that I have run into myself. To solve it, I made /bin/sh the default shell for root on all new FreeBSD deployments. I didn't really think anything of it, but now that you mention it, I would have to agree that perhaps this caveat should be listed in doc/man/man1/cdist.text or doc/man/man7/cdist-quickstart.text.

Thoughts on this, Nico?

*Created by: jdguffey* Indeed. This is an issue that I have run into myself. To solve it, I made /bin/sh the default shell for root on all new FreeBSD deployments. I didn't really think anything of it, but now that you mention it, I would have to agree that perhaps this caveat should be listed in doc/man/man1/cdist.text or doc/man/man7/cdist-quickstart.text. Thoughts on this, Nico?
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#316
No description provided.