0

In the Exec= line of a service menu in kde4, I normally use:

Exec=command %f

So I wonder, if it's necessary to quote the %f, not sure how KDE4 parses the menu file, i.e

Exec=command "%f"

daisy
  • 53,527
  • 78
  • 236
  • 383

1 Answers1

0

I've found several threads where people have included the quotes around the arguments in the Exec= lines. I believe you need them if the arguments you're dealing with include spaces.

For example this thread titled: shell scripting basics.. how to forward double quotes ??.

excerpt

I'm trying to make servicemenu entry to kde what unrar:s files I select. I put this to servicemenu file:

Exec=/usr/bin/extract 1 %U

and in /usr/bin/extract I have:

if [ $1 = "1" ]; then
    unrar e "$2"
fi  
if [ $1 = "2" ]; then
    unrar x "$2"
fi   

It works fine except if filename includes spaces.

So it would appear that you can get away with not using quotes unless you're dealing with either:

  • paths that includes spaces
  • file names that include spaces
  • command line arguments that includes spaces.
slm
  • 363,520
  • 117
  • 767
  • 871