[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Syntax regarding "Exec" instruction in .desktop files

Hi Greg,

1 juin 2020 à 15:25 de wooledg@eeg.ccf.org:

> On Mon, Jun 01, 2020 at 03:12:03PM +0200, l0f4r0@tuta.io wrote:
>> Let's take an example, here is my fusuma.desktop file:[Desktop Entry]
>> Type=Application
>> Name=fusuma
>> Exec=sh -c 'if which ruby >/dev/null && which gem >/dev/null; then $(ruby -r rubygems -e "puts Gem.user_dir")/bin/fusuma -d; fi'
> You have not followed the allowed syntax.  You have an argument which
> needs quoting, but you have not enclosed it in double-quotes.  Nor have
> you escaped the characters within it that need escaping.
Yes, absolutely, that's why I mentioned my modifications some lines after in my OP ;)
What would be your 100% compliant version please?

> I would not even *attempt* to do what you are trying to do here.  Your
> life would become enormously simpler if you would just put this shell
> script inside a file, and Exec it as a script.
> Attempting to in-line a shell script inside an Exec= line is madness.
Interesting. Is it madness because it becomes too much complicated to write it easily and correctly according to the official specifications (namely quoting/escaping...)? Or for different reasons?

Thank you in advance.
Best regards,

Reply to: