Added to the FAQ more details about how to use csh. #1483

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@mradziej
mradziej commented Jul 7, 2016

There are multiple open issues in github about csh and quoting, also
on StackOverflow and else.

Background:

With normal settings (use_shell=True, shell_escape=True), a command that has
env.env_vars is wrapped and handed to the csh as:

/bin/bash -l -c "export FOO="bar" && actual-command"

If in the csh setting backslash_quote is not set, csh does not handle the "
as expected, but reads the command line as (one line per arg):

/bin/bash
-l
-c
export FOO=
bar
&& actual-command

... and chokes on the final "

Michael Radziej Added to the FAQ more details about how to use csh.
There are multiple open issues in github about csh and quoting, also
on StackOverflow and else.

Background:

With normal settings (use_shell=True, shell_escape=True), a command that has
env.env_vars is wrapped and handed to the csh as:

/bin/bash -l -c "export FOO=\"bar\" && actual-command"

If in the csh setting backslash_quote is not set, csh does not handle the \"
as expected, but reads the command line as (one line per arg):

/bin/bash
-l
-c
export FOO=\
bar\
&& actual-command

... and chokes on the final "
050ecf1
@bitprophet
Member

Thanks for this!

You touched enough other outstanding issues (like #1374) that I'm probably going to try making a FBSD VM sometime so I can doublecheck the problem, but I'll be pretty happy if backslash_quote does make things a lot more compatible.

Wondering why this didn't come up prior - especially given the earlier FAQ content claiming that /bin/sh -c was sufficient to make things work. Could this be something that has changed in FreeBSD over the last 5-8 years? E.g.:

  • Changing what /bin/sh points to, if it wasn't csh before;
  • Upgrading to a new major version of csh that changed semantics/behavior/default config settings;
  • Changes to the default systemwide shell config files (assuming FBSD does what many Linux distros do, and has default user dotfiles include a systemwide conf file);
  • etc.
@bitprophet bitprophet added this to the 1.10.4 milestone Jul 19, 2016
@mradziej

Hey, I'm glad if I was able to help out.

In my case, it's SUSE Linux SLES 11 patchlevel 4. I have no idea whether there is customization or whether it's the defaults that way. It's a confusing issue, and it might turn up only when there are environment variables. I did not test it on anything else, but from reading the documentation for csh it's quite obvious. In the bug reports you can also find the telltale sign message about the missing " ' ".

Fun fact: I requested to be changed to bash as login shell, but it took so long that I was really annoyed by the problem and took the time to read through. And now I'm on bash ;)

@bitprophet
Member

In testing this out, it seems like the actual error message is simply Unmatched ". - going to add that to this update so it's got better SEO etc :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment