Skip to content
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

Startup script strips quotes from command line parameter values #37

Open
edschindler opened this issue Jan 12, 2025 · 3 comments
Open

Comments

@edschindler
Copy link

I was having trouble using the command line to download my season pass list:

./kmttg -sp "DVR 0000" -spf "backup.sp"

Which would hang, but I could get and save the season passes in the UI.

Investigation showed that the startup shell script kmttg is stripping the double quotes from the DVR name and the file name when it forms the full java command to launch kmttg proper. Which is to say, sh is stripping them when referring to the command line params as $@.

I confirmed by manually typing the entire java command, with the quotes, and it ran fine.

An obvious workaround is to rename the dvr and remove the space... but this is the default naming and the startup script should do it right. The output file name may well include spaces as well, of course. For my application, another workaround will work: I can run the full java command directly.

I am barely shell-literate, so I can't suggest a fix to what seems like should be a simple problem (but from casual searching it seems that it isn't! -- my experiments with bash's ${@@q} were unsuccessful.).

Linux Mint 22, kmttg V2.9-l

@thess
Copy link

thess commented Jan 12, 2025

in kmttg change the $@ to "$@" and bash magic will happen

Note that this is a special form. If you add anything else in the quotes the result will get combined into a single argument.

@edschindler
Copy link
Author

Yes, thanks @thess , this worked in the startup script, so it must not be bash-only, fortunately. Mint/Ubuntu/Debian uses dash for sh.

@lart2150 , I will not do a pull request for such a trivial change.

@thess
Copy link

thess commented Jan 13, 2025

POSIX compatibility ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants