react-bash icon indicating copy to clipboard operation
react-bash copied to clipboard

Quotes

Open nloveladyallen opened this issue 8 years ago • 3 comments

hacker@default ~ $echo "foo"
"foo"

nloveladyallen avatar Jul 01 '16 23:07 nloveladyallen

Implementing this seems to require building a more robust parser from scratch i.e. a character-by-character crawl. Might be my limited JavaScript knowledge, but I can't think of a nice way to parse with .split sequence. Even so, a hacky .split that includes splitting by " and looking for matching quotes etc. might be more complex/inefficient than just a O(n) walk of the input. Per the ECMA spec, each call to split will walk down the string left-to-right. Unless we come up with some uber-ninja regex that fits the bash grammar 😛

Thoughts @zackargyle?

derekargueta avatar Nov 16 '16 20:11 derekargueta

I've made a commit to remedy this. echo $PATH "hello world" will show / hello world

Is this the correct behavior?

ErezSha avatar Feb 19 '17 16:02 ErezSha

@ErezSha that looks correct, yes.

Sorgrum avatar Jan 18 '18 16:01 Sorgrum