-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quoted arguments get broken up #32
Comments
This sounds like a common mistake. I don't know where it is or how to fix it for your case. Can I get the script in question here? |
Sorry I should make it clear that I'm not claiming it's your mistake... It's just common for quotes to be dropped at times. But I can't identify the place this is happening (in my library or wherever) until I see the context. |
This is because the I see you already have a bash-array branch for this sort of stuff. Why not try resurrecting it? |
* ARGV is now an array. Should fix kristopolous#32. * Quotes and stuff, also in generated code. * Not using `...` is a good idea because it effs up badly when you nest them. It's also in shellcheck. * Catch bad args in tickVars. * * * POSIX interaction, in case people want it later: * No arrays, but we aren't gonna do the transpiling anyways. * No +=, so it's gonna be dreadfully slow for long args. Remember the quadratic string append stuff in JS? Yeah it's exactly that. * No ${var/pat/sub}, so dreadfully slow again. Prefix and suffix trimming is available though. * No (( ... )), but `: $(( ))` is the same. Except for `++`.
TickTick provides, in my opinion, an API that is obviously much nicer than the other bash JSON parsers. So I was using it in my script.
Unfortunately, I had to switch to JSON.sh because I could not figure out (at least not in the hour or so I spent diagnosing and trying to fix this issue, I am not a bash expert) how to fix this problem: when passing arguments that are quoted for example
myscript last Smith first John address "123 Main St."
after the. ./ticktick.sh
the last arguments change as if they were not quoted e.g.myscript last Smith first Smith address 123 Main St.
. I am usingshift
in part of my script to read key/value pairs from the arguments and I was gettingMain
assigned as a key rather than part of theaddress
value.The text was updated successfully, but these errors were encountered: