Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #222972

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

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: Syntax regarding "Exec" instruction in .desktop files
Date 2020-06-01 15:30 +0200
Message-ID <AcSFP-87G-11@gated-at.bofh.it> (permalink)
References <AcSw9-84u-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jun 01, 2020 at 03:12:03PM +0200, l0f4r0@tuta.io wrote:
> "Arguments may be quoted in whole. If an argument contains a reserved character the argument must be quoted. The rules for quoting of arguments is also applicable to the executable name or path of the executable program as provided.

> Quoting must be done by enclosing the argument between double quotes and escaping the double quote character, [...]

OK so far.

> 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.

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.

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Syntax regarding "Exec" instruction in .desktop files l0f4r0@tuta.io - 2020-06-01 15:20 +0200
  Re: Syntax regarding "Exec" instruction in .desktop files Greg Wooledge <wooledg@eeg.ccf.org> - 2020-06-01 15:30 +0200
    Re: Syntax regarding "Exec" instruction in .desktop files l0f4r0@tuta.io - 2020-06-01 17:40 +0200
      Re: Syntax regarding "Exec" instruction in .desktop files Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-01 20:10 +0200
        Re: Syntax regarding "Exec" instruction in .desktop files l0f4r0@tuta.io - 2020-06-01 20:40 +0200
          Re: Syntax regarding "Exec" instruction in .desktop files Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-02 07:50 +0200
  Re: Syntax regarding "Exec" instruction in .desktop files l0f4r0@tuta.io - 2020-06-22 19:50 +0200
    Re: Syntax regarding "Exec" instruction in .desktop files Greg Wooledge <wooledg@eeg.ccf.org> - 2020-06-22 19:50 +0200
    Re: Syntax regarding "Exec" instruction in .desktop files davidson <davidson@freevolt.org> - 2020-06-23 01:00 +0200

csiph-web