Xonsh: Strings split on `-and`

Created on 31 Oct 2016  路  6Comments  路  Source: xonsh/xonsh

Reproduce:

$ touch fooandbar foo-bar foo-and-bar

Expected:

[No output]
$ ls
foo-and-bar  foo-bar  fooandbar

Actual:

xonsh: subprocess mode: command not found: bar
Did you mean one of the following?
[Snip]
$ ls
foo-  foo-bar  fooandbar

Workaround:

$ touch 'foo-and-bar'
$ ls
foo-and-bar

This is similar to #1432 discussion on quoting/escaping of special characters; in particular whitespace. But I think this is a distinct issue and I very much hope that _this_ is not intended behaviour.

bug

Most helpful comment

Hi @OJFord - thanks for reporting. This is not the intended behaviour. and, or, and not should only be keywords when surrounded by whitespace.

All 6 comments

Hi @OJFord - thanks for reporting. This is not the intended behaviour. and, or, and not should only be keywords when surrounded by whitespace.

I have the same issue using -or with find on 0.5.0 .

This is probably a bug in the parser. AND and OR tokens should be separated by whitespace.

Yes, I had a fiddle with it, but I didn't have any luck without breaking other behaviour. I'm happy to have another look in the new year.

Potential fix in #2274

Closing this since #2274 has been merged. Please fee free to reopen if needed

Was this page helpful?
0 / 5 - 0 ratings