Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass argument starting with minus sign to shell command

I want to run the following (KDE specific) command with an argument (-0.1) that starts with '-'

kdialog --textinputbox 'Output:' '-0.1'

It is suposed to show a textbox with '-0.1' but the command gives

unknown option "-0.1"

while

kdialog --textinputbox 'Output:' '0.1'

works. Obviously the command tries to interpret 0.1 as an option. Is there a way to pass the argument "-0.1" to such commands? I tried passing it as variable which didn't work either!

like image 659
highsciguy Avatar asked Sep 17 '25 01:09

highsciguy


1 Answers

Try with:

kdialog --textinputbox 'Output:' -- '-0.1'

-- means "end of options" and should work for all Qt (thus KDE) apps that use the standard argument functions for that framework.

like image 132
Mat Avatar answered Sep 18 '25 17:09

Mat