Open aommm opened 2 years ago
This seems to be caused by passing the '{"a":"b"}'
argument through multiple different shells, each shell stripping some of the quotes. In my case, the outermost quotes '
are stripped by fish, and the innermost "
are stripped by bash.
I wanted to solve this without forcing the user to write a bunch of \
manually. I managed to create a workaround that works in my case.
I'm creating a new fish function myscript
that wraps my-script.sh
:
function myscript
# Need to transform {"a":1} into {\"a\":1} before passing to bass
set quoted_argv (echo "$argv" | sed --expression 's/"/\\\\"/g')
bass source /path/to/my-script.sh "$quoted_argv"
end
This then works correctly:
> myscript '{"a":"b"}'
{"a":"b"}
Thanks for documenting this. Can we close this then?
Yep it can!
Hi,
First of all, this is probably not a bug but more of a support request. Sorry if this is the wrong forum!
Quotes from my input arguments disappear when I run my script though
bass
, but they remain when I run it throughbash
.I have a script:
When I run it with bash the quotes are preserved (expected):
However, when I run it through bass then the quotes disappear (unexpected):
Would love to get some guidance here! Again, this is probably not a bug in
bass
, but just a lack of understanding on my part.