• Need help with shell script.

    From pH@wNOSPAMp@gmail.org to comp.os.linux.misc on Sun Aug 9 23:32:43 2026
    From Newsgroup: comp.os.linux.misc

    Using Linux Mint

    My wife downloads photos from her camera and leaves them in the "Desktop" directory.

    I put them where they belong (from a terminal) w/
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    where Beckys_stuff is a directory

    so I thought I'd make a clickable icon on the Desktop to make it easy for
    her.
    the file "move_pictures" contains:
    !/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    I saved it in my 'scripts' directory and and did "chmod +x move_pictures"

    I then created a new launcher on the desktop with the command field filled
    in as: ~/scripts/move_pictures

    But when I click on it I get an error messaage that pops up in a small
    window that says: "There was an error launching the application"

    Every variation I've tried (like removing the !/bin/bash shebang) has led to the same message.

    What am I doing wrong?

    pH in Aptos

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Eli the Bearded@*@eli.users.panix.com to comp.os.linux.misc on Mon Aug 10 01:01:12 2026
    From Newsgroup: comp.os.linux.misc

    In comp.os.linux.misc, pH <wNOSPAMp@gmail.org> wrote:
    so I thought I'd make a clickable icon on the Desktop to make it easy for her.
    the file "move_pictures" contains:
    !/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    If that's your script, one issue looks like the first line:

    #!/bin/bash

    Start with a # and no comma.

    But when I click on it I get an error messaage that pops up in a small
    window that says: "There was an error launching the application"

    There may be more things wrong that are specific to how you created the launcher, but I don't know anything about Mint launchers.

    Elijah
    ------
    would probably make the script work with lowercase suffixes, too
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc on Mon Aug 10 01:36:47 2026
    From Newsgroup: comp.os.linux.misc

    On Sun, 9 Aug 2026 23:32:43 -0000 (UTC), pH wrote:

    But when I click on it I get an error messaage that pops up in a
    small window that says: "There was an error launching the
    application"

    Eli suggests a fix. For myself, I would like to determine, for future reference, where the detailed error message from such a failure is
    likely to appear.

    My guess is, a command like this

    journalctl --user --since=today

    would offer some clues.

    Another variant: have this

    journalctl --user -f

    continuously running in a terminal window, double-click your script
    icon, and see what appears.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From c186282@c186282@nnada.net to comp.os.linux.misc on Mon Aug 10 00:23:24 2026
    From Newsgroup: comp.os.linux.misc

    On 8/9/26 21:01, Eli the Bearded wrote:
    In comp.os.linux.misc, pH <wNOSPAMp@gmail.org> wrote:
    so I thought I'd make a clickable icon on the Desktop to make it easy for
    her.
    the file "move_pictures" contains:
    !/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    If that's your script, one issue looks like the first line:

    #!/bin/bash

    Start with a # and no comma.

    But when I click on it I get an error messaage that pops up in a small
    window that says: "There was an error launching the application"

    There may be more things wrong that are specific to how you created the launcher, but I don't know anything about Mint launchers.

    Elijah
    ------
    would probably make the script work with lowercase suffixes, too

    As "Beckys stuff" may be a TWO-word dir, it's important
    to PUT that all in QUOTES or 'mv' will get confused.
    The example shows an underscore, but is that there in
    the actual script ?

    Also, has it been marked as 'executable' and WHO
    owns it ??? Finally, command line, the evocation
    usually requires a dot in front of everything.

    The "#!/bin/bash" is kind of optional these days
    because almost everyone has Bash as their main
    thing anyway. SOME do install and use other shells,
    but only SOME. I think I have c-shell installed
    alongside Bash.

    Anyway, try the exact command in terminal and if
    that works then it OUGHT to run as a script.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From pH@wNOSPAMp@gmail.org to comp.os.linux.misc on Mon Aug 10 04:59:28 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-08-10, Eli the Bearded <*@eli.users.panix.com> wrote:
    In comp.os.linux.misc, pH <wNOSPAMp@gmail.org> wrote:
    so I thought I'd make a clickable icon on the Desktop to make it easy for
    her.
    the file "move_pictures" contains:
    !/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    If that's your script, one issue looks like the first line:

    #!/bin/bash

    Start with a # and no comma.


    The pics and pdf's she saves are guaranteed uppercase.
    I fixed the shebang...heck, I hadn't even noticed the comma!

    No luck so far but thanks for the reply.

    pH


    But when I click on it I get an error messaage that pops up in a small
    window that says: "There was an error launching the application"

    There may be more things wrong that are specific to how you created the launcher, but I don't know anything about Mint launchers.

    Elijah
    ------
    would probably make the script work with lowercase suffixes, too
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From pH@wNOSPAMp@gmail.org to comp.os.linux.misc on Mon Aug 10 05:04:58 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-08-10, c186282 <c186282@nnada.net> wrote:
    On 8/9/26 21:01, Eli the Bearded wrote:
    In comp.os.linux.misc, pH <wNOSPAMp@gmail.org> wrote:
    so I thought I'd make a clickable icon on the Desktop to make it easy for >>> her.
    the file "move_pictures" contains:
    !/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    If that's your script, one issue looks like the first line:

    #!/bin/bash

    Start with a # and no comma.

    But when I click on it I get an error messaage that pops up in a small
    window that says: "There was an error launching the application"

    There may be more things wrong that are specific to how you created the
    launcher, but I don't know anything about Mint launchers.

    Elijah
    ------
    would probably make the script work with lowercase suffixes, too

    As "Beckys stuff" may be a TWO-word dir, it's important
    to PUT that all in QUOTES or 'mv' will get confused.
    The example shows an underscore, but is that there in
    the actual script ?

    Beckys_stuff does indeed have an underscore and it is that way in the actual script.


    Also, has it been marked as 'executable' and WHO
    owns it ??? Finally, command line, the evocation
    usually requires a dot in front of everything.
    Well, since I created it I just assumed I owned it.
    I have done a "chown MYUSER move_pictures

    and we'll see what happens.

    Can you elaborate on where I need the dot...in the launcher command field?
    I'll give it a try...



    The "#!/bin/bash" is kind of optional these days
    because almost everyone has Bash as their main
    thing anyway. SOME do install and use other shells,
    but only SOME. I think I have c-shell installed
    alongside Bash.

    Anyway, try the exact command in terminal and if
    that works then it OUGHT to run as a script.

    It works fine when I type it manually in a terminal which is why I thought
    it'd be a piece of cake as a script.

    pH


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From rbowman@bowman@montana.com to comp.os.linux.misc on Mon Aug 10 05:41:21 2026
    From Newsgroup: comp.os.linux.misc

    On Mon, 10 Aug 2026 04:59:28 -0000 (UTC), pH wrote:

    The pics and pdf's she saves are guaranteed uppercase.
    I fixed the shebang...heck, I hadn't even noticed the comma!

    No luck so far but thanks for the reply.

    Maybe the fully qualified path /home/xxx/Desktop ?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From rbowman@bowman@montana.com to comp.os.linux.misc on Mon Aug 10 05:44:35 2026
    From Newsgroup: comp.os.linux.misc

    On Mon, 10 Aug 2026 05:04:58 -0000 (UTC), pH wrote:

    Well, since I created it I just assumed I owned it.
    I have done a "chown MYUSER move_pictures

    did you make it executable?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.os.linux.misc on Mon Aug 10 12:12:40 2026
    From Newsgroup: comp.os.linux.misc

    On 10/08/2026 06:04, pH wrote:
    On 2026-08-10, c186282 <c186282@nnada.net> wrote:
    On 8/9/26 21:01, Eli the Bearded wrote:
    In comp.os.linux.misc, pH <wNOSPAMp@gmail.org> wrote:
    so I thought I'd make a clickable icon on the Desktop to make it easy for >>>> her.
    the file "move_pictures" contains:
    !/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    If that's your script, one issue looks like the first line:

    #!/bin/bash

    Start with a # and no comma.

    But when I click on it I get an error messaage that pops up in a small >>>> window that says: "There was an error launching the application"

    There may be more things wrong that are specific to how you created the
    launcher, but I don't know anything about Mint launchers.

    Elijah
    ------
    would probably make the script work with lowercase suffixes, too

    As "Beckys stuff" may be a TWO-word dir, it's important
    to PUT that all in QUOTES or 'mv' will get confused.
    The example shows an underscore, but is that there in
    the actual script ?

    Beckys_stuff does indeed have an underscore and it is that way in the actual script.


    Also, has it been marked as 'executable' and WHO
    owns it ??? Finally, command line, the evocation
    usually requires a dot in front of everything.
    Well, since I created it I just assumed I owned it.
    I have done a "chown MYUSER move_pictures

    and we'll see what happens.

    Can you elaborate on where I need the dot...in the launcher command field? I'll give it a try...



    The "#!/bin/bash" is kind of optional these days
    because almost everyone has Bash as their main
    thing anyway. SOME do install and use other shells,
    but only SOME. I think I have c-shell installed
    alongside Bash.

    Anyway, try the exact command in terminal and if
    that works then it OUGHT to run as a script.

    It works fine when I type it manually in a terminal which is why I thought it'd be a piece of cake as a script.

    Does it work when you yourself call it *as a script* ?

    For some reason none of my desktop icons call scripts.. (Mint MATE) I
    suspect because it didn't work for me either...or they needed root perms
    and have C wrappers to do the setuid(0) bit...

    e,g.

    #include <stdlib.h>
    #include <unistd.h>
    main()
    {
    setuid(0);
    system("/usr/local/scripts/my-script");
    }

    the c program is 666 perms owned and grouped by root sticky bit set

    -rwsr-xr-x 1 root root 16744 Oct 9 2021 my-script

    The behaviour you describe is hauntingly familiar, but I cannot recall
    why...

    You may care to inspect the desktop file itself...
    If its on the desktop its in ~/Desktop/myfile etc
    Or for panel pinned launchers

    ~/.config/mate/panel2.d/default/launchers..

    $ more mater-terminal.desktop
    #!/usr/bin/env xdg-open

    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Icon=/usr/local/share/icons/Desktop/cymbeline.png Icon[en_GB]=/usr/local/share/icons/Desktop/cymbeline.png
    Name[en_GB]=Cymbeline
    Exec=mate-terminal --profile=Cymbeline
    Comment[en_GB]=Local server console
    Name=Cymbeline
    Comment=Local server console

    Note that xdg-open does the opening.

    Its bot recommended to invoke this via the command line BUT if you do it
    might give some meaningful errosr message

    pH


    --
    "And if the blind lead the blind, both shall fall into the ditch".

    Gospel of St. Mathew 15:14


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Stanislav N. aka pztrn@pztrn@oldproto.invalid to comp.os.linux.misc on Mon Aug 10 16:31:48 2026
    From Newsgroup: comp.os.linux.misc

    10.08.2026 09:23, c186282 wrote:
    -a The "#!/bin/bash" is kind of optional these days
    -a because almost everyone has Bash as their main
    -a thing anyway. SOME do install and use other shells,
    -a but only SOME. I think I have c-shell installed
    -a alongside Bash.

    It *isn't optional* if you aren't launching it with bash like:

    bash ./script.sh

    Otherwise system won't know how to launch it.

    Actually with shebang (that is how it called) you can run almost anything in "interpretator mode" (e.g. without prior compiling).

    Notable exception is Go (and there are some others):

    ---code start

    ///usr/bin/env go run "$0" "$@" ; exit

    package main

    import "fmt"

    func main() {
    fmt.Println("Hello, world!")
    }

    ---code end

    Kind-of shebang, but not shebang.

    Anyway, shebangs are useful mostly for interpretators like shell variations, python, perl and so on. Example above isn't really useful because Go will compile in native machine code (read: produce runnable binary file) blazingly fast.
    --
    WBR, Stanislav Nikitin a.k.a. pztrn.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From vallor@vallor@vallor.earth to comp.os.linux.misc on Mon Aug 10 11:38:33 2026
    From Newsgroup: comp.os.linux.misc

    At Mon, 10 Aug 2026 12:12:40 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 10/08/2026 06:04, pH wrote:
    On 2026-08-10, c186282 <c186282@nnada.net> wrote:
    On 8/9/26 21:01, Eli the Bearded wrote:
    In comp.os.linux.misc, pH <wNOSPAMp@gmail.org> wrote:
    so I thought I'd make a clickable icon on the Desktop to make it
    easy for her. the file "move_pictures" contains: !/bin/bash, mv
    ~/Desktop/*JPG ~/Desktop/Beckys_stuff/ mv ~/Desktop/*PDF
    ~/Desktop/Beckys_stuff/

    If that's your script, one issue looks like the first line:

    #!/bin/bash

    Start with a # and no comma.

    But when I click on it I get an error messaage that pops up in a
    small window that says: "There was an error launching the
    application"

    There may be more things wrong that are specific to how you
    created the launcher, but I don't know anything about Mint
    launchers.

    Elijah
    ------
    would probably make the script work with lowercase suffixes, too

    As "Beckys stuff" may be a TWO-word dir, it's important
    to PUT that all in QUOTES or 'mv' will get confused.
    The example shows an underscore, but is that there in
    the actual script ?

    Beckys_stuff does indeed have an underscore and it is that way in
    the actual script.


    Also, has it been marked as 'executable' and WHO
    owns it ??? Finally, command line, the evocation
    usually requires a dot in front of everything.
    Well, since I created it I just assumed I owned it.
    I have done a "chown MYUSER move_pictures

    and we'll see what happens.

    Can you elaborate on where I need the dot...in the launcher command
    field? I'll give it a try...



    The "#!/bin/bash" is kind of optional these days
    because almost everyone has Bash as their main
    thing anyway. SOME do install and use other shells,
    but only SOME. I think I have c-shell installed
    alongside Bash.

    Anyway, try the exact command in terminal and if
    that works then it OUGHT to run as a script.

    It works fine when I type it manually in a terminal which is why I
    thought it'd be a piece of cake as a script.

    Does it work when you yourself call it *as a script* ?

    For some reason none of my desktop icons call scripts.. (Mint MATE) I
    suspect because it didn't work for me either...or they needed root
    perms and have C wrappers to do the setuid(0) bit...

    Excuse me, but...no. (I'm not sure why you thought that would
    be necessary, but it isn't.)
    --
    -v System76 Thelio Mega v1.1 x86_64 Mem: 258G
    OS: Linux 7.2.0-rc7 D: Mint 22.3 DE: Xfce 4.18 (X11)
    NVIDIA GeForce RTX 3090Ti (24G) (610.57.04)
    "The most expensive component is the one that breaks."
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Stanislav N. aka pztrn@pztrn@oldproto.invalid to comp.os.linux.misc on Mon Aug 10 16:40:56 2026
    From Newsgroup: comp.os.linux.misc

    10.08.2026 16:12, The Natural Philosopher wrote:
    The behaviour you describe is hauntingly familiar, but I cannot recall why...

    On my systems (arch and debian) that behavior was observed only if:

    1. Script has no executable bit set.
    2. Commands in script returns anything other than 0

    Probably it's #2 and I propose to change script into this:

    #!/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/ || true
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/ || true

    Or even better:

    #!/bin/bash,

    set +e

    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    set -e
    --
    WBR, Stanislav Nikitin a.k.a. pztrn.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From pH@wNOSPAMp@gmail.org to comp.os.linux.misc on Mon Aug 10 19:17:21 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-08-10, pH <wNOSPAMp@gmail.org> wrote:
    On 2026-08-10, Eli the Bearded <*@eli.users.panix.com> wrote:
    In comp.os.linux.misc, pH <wNOSPAMp@gmail.org> wrote:
    so I thought I'd make a clickable icon on the Desktop to make it easy for >>> her.
    the file "move_pictures" contains:
    !/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    If that's your script, one issue looks like the first line:

    #!/bin/bash

    Start with a # and no comma.


    The pics and pdf's she saves are guaranteed uppercase.
    I fixed the shebang...heck, I hadn't even noticed the comma!

    No luck so far but thanks for the reply.

    pH


    But when I click on it I get an error messaage that pops up in a small
    window that says: "There was an error launching the application"

    There may be more things wrong that are specific to how you created the
    launcher, but I don't know anything about Mint launchers.

    Elijah
    ------
    would probably make the script work with lowercase suffixes, too

    Well I have success now.

    Instead of trying to create a "Launcher" for Mint I simply put the script
    into the "Desktop" directory where it shows up as an icon.

    Then simply clicking on it allows it to run as I expected.
    It does ask if I want to just run it or run it in a terminal, but that's a simple thing my wife will not have a problem with.

    Thanks for all the suggestions.

    pH
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From pH@wNOSPAMp@gmail.org to comp.os.linux.misc on Mon Aug 10 19:22:35 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-08-10, rbowman <bowman@montana.com> wrote:
    On Mon, 10 Aug 2026 05:04:58 -0000 (UTC), pH wrote:

    Well, since I created it I just assumed I owned it.
    I have done a "chown MYUSER move_pictures

    did you make it executable?

    Yes. And made sure I was the owner as another poster suggested.

    However, I have done a workaround and now it's working as expected.
    (Skipped tring to make a "launcher".

    This is Linux Mint 22 Wilma. If one right-clicks on the screen the option
    to create a 'launcher' comes up in the menu of available actions. That's
    what i had problems with.
    Just putting the script in the directory of interest does fine...it shows up and can be clicked upon which then runs it.

    In a perfect world I'd keep trying to get the launcher to work, but I have other things to do.

    pH
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From pH@wNOSPAMp@gmail.org to comp.os.linux.misc on Mon Aug 10 19:27:17 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-08-10, Stanislav N. aka pztrn <pztrn@oldproto.invalid> wrote:
    10.08.2026 16:12, The Natural Philosopher wrote:
    The behaviour you describe is hauntingly familiar, but I cannot recall why...

    On my systems (arch and debian) that behavior was observed only if:

    1. Script has no executable bit set.
    2. Commands in script returns anything other than 0

    Probably it's #2 and I propose to change script into this:

    #!/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/ || true
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/ || true

    Or even better:

    #!/bin/bash,

    set +e

    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    set -e



    Thanks for the response.

    Even though I've got the thing working "well enough", I think I will give
    this a try and see if the "launcher" complains.

    (and you made me read up on "set"...always a good thing to learn a bit)

    pH
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From gazelle@gazelle@shell.xmission.com (Kenny McCormack) to comp.os.linux.misc on Mon Aug 10 20:08:15 2026
    From Newsgroup: comp.os.linux.misc

    In article <115d841$3d7jb$1@dont-email.me>, pH <wNOSPAMp@gmail.org> wrote:
    ...
    Instead of trying to create a "Launcher" for Mint I simply put the script >into the "Desktop" directory where it shows up as an icon.

    Then simply clicking on it allows it to run as I expected.
    It does ask if I want to just run it or run it in a terminal, but that's a >simple thing my wife will not have a problem with.

    (I have very little experience with running stuff via "desktop icons" in
    Linux, and no experience at all with "Linux Mint/Mate/etc", but still...)

    I know from chatter on the Rpi board that it is possible to setup a
    "desktop thingie" in RaspiOS-with-LXDE and that there is an option (a box
    to tick) in the desktop thingie that says to not prompt for whether or not
    to run it in a terminal - i.e., to just go ahead and do the right thing (whatever that is).

    I'm guessing that the same is possible in your DE.
    --
    The coronavirus is the first thing, in his 74 pathetic years of existence,
    that the orange menace has come into contact with, that he couldn't browbeat, bully, bullshit, bribe, sue, legally harrass, get Daddy to fix, get his siblings to bail him out of, or, if all else fails, simply wish it away.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc on Mon Aug 10 23:58:49 2026
    From Newsgroup: comp.os.linux.misc

    On Mon, 10 Aug 2026 16:40:56 +0500, Stanislav N. aka pztrn wrote:

    1. Script has no executable bit set.

    Error message: rCLpermission deniedrCY.

    rCLBut itrCOs MY FILE! I created it, it belongs to me, I have full access
    over it! What possible rCypermissionrCO am I being denied?rCY

    Answer: execute access.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Farley Flud@ff@gnulinux.rocks to comp.os.linux.misc on Tue Aug 11 00:19:27 2026
    From Newsgroup: comp.os.linux.misc

    On Mon, 10 Aug 2026 23:58:49 -0000 (UTC), Lawrence DrCOOliveiro wrote:


    rCLBut itrCOs MY FILE! I created it, it belongs to me, I have full access over it! What possible rCypermissionrCO am I being denied?rCY

    Answer: execute access.


    Execute permissions are only required if the file is being handled
    by the kernel execve() system call.

    Otherwise, any executable file can be executed without having
    execute permission by simply invoking the appropriate interpreter.

    For binary execs:

    /lib64/ld-linux-x86-64.so.2 file

    For perl scripts:

    perl file.pl

    Of course, strip any exec permissions before demonstrating this.
    --
    Gentoo/LFS: Is there any-fucking-thing else?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From c186282@c186282@nnada.net to comp.os.linux.misc on Mon Aug 10 21:14:12 2026
    From Newsgroup: comp.os.linux.misc

    On 8/10/26 07:31, Stanislav N. aka pztrn wrote:
    10.08.2026 09:23, c186282 wrote:
    -a-a The "#!/bin/bash" is kind of optional these days
    -a-a because almost everyone has Bash as their main
    -a-a thing anyway. SOME do install and use other shells,
    -a-a but only SOME. I think I have c-shell installed
    -a-a alongside Bash.

    It *isn't optional* if you aren't launching it with bash like:

    -a-a-a bash ./script.sh

    Otherwise system won't know how to launch it.

    A special case admittedly.

    However most either "./MyScript.sh" or run it
    without the dot-slash from crontab or one of
    the "system" calls inside popular langs.

    Actually with shebang (that is how it called) you can run almost
    anything in "interpretator mode" (e.g. without prior compiling).

    Bash scripts are always interpreted ...

    If you're gonna do interpreted these days, use Python.

    It's a hell of a lot easier to read also ...

    Notable exception is Go (and there are some others):

    ---code start

    ///usr/bin/env go run "$0" "$@" ; exit

    package main

    import "fmt"

    func main() {
    -a-a-a-a-a-a-a fmt.Println("Hello, world!")
    }

    ---code end

    Kind-of shebang, but not shebang.

    Anyway, shebangs are useful mostly for interpretators like shell
    variations, python, perl and so on. Example above isn't really useful because Go will compile in native machine code (read: produce runnable binary file) blazingly fast.

    Never used 'Go' and probably never will.

    Most of the newer 'improved' langs aren't "improved"
    at all. Most just look like 'C' with less-convenient
    syntax.


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Nuno Silva@nunojsilva@invalid.invalid to comp.os.linux.misc on Tue Aug 11 08:56:46 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-08-10, pH wrote:

    Using Linux Mint

    My wife downloads photos from her camera and leaves them in the "Desktop" directory.

    I put them where they belong (from a terminal) w/
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    where Beckys_stuff is a directory

    so I thought I'd make a clickable icon on the Desktop to make it easy for her.
    the file "move_pictures" contains:
    !/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    I saved it in my 'scripts' directory and and did "chmod +x move_pictures"

    I then created a new launcher on the desktop with the command field filled
    in as: ~/scripts/move_pictures

    But when I click on it I get an error messaage that pops up in a small
    window that says: "There was an error launching the application"

    Every variation I've tried (like removing the !/bin/bash shebang) has led to the same message.

    What am I doing wrong?


    I did read the thread so far, but apologies if something was already
    mentioned and I managed to overlook it:

    1) Is GNU bash installed at (or somehow reachable at) /bin/bash ?

    2) Does the script work when you invoke it manually, with no launcher
    involved? I don't mean the commands used, but the script itself, with
    e.g. ./move_pictures.

    (Oh, and: if supported by that implementation of cp, won't you want to
    add -n to the options? (Or perhaps --update=none, which apparently is
    what GNU cp now encourages as a (lengthy?) replacement to -n?)

    To put it in another way: What is your approach to avoid overwriting
    files with the same name?)
    --
    Nuno Silva
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Marco Moock@mm@dorfdsl.de to comp.os.linux.misc on Tue Aug 11 15:59:14 2026
    From Newsgroup: comp.os.linux.misc

    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it easy for her.

    What does that mean?
    Is it a .desktop file with the right content?
    --
    Gru|f
    Marco

    Please send unsolicited mail to dustbin12@stinkedores.dorfdsl.de
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From gazelle@gazelle@shell.xmission.com (Kenny McCormack) to comp.os.linux.misc on Tue Aug 11 16:49:33 2026
    From Newsgroup: comp.os.linux.misc

    In article <115f9ri$1usk$1@dont-email.me>, Marco Moock <mm@dorfdsl.de> wrote: >Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it easy for
    her.

    What does that mean?
    Is it a .desktop file with the right content?

    Nobody knows. And, at this point, nobody cares (if they ever did).

    The problem is that this has nothing to do with either Linux or shell scripting, but has to do with the vagaries of one particular DE.

    Anyway, OP has a solution, which was just to put the script itself in ~/Desktop, where it is thus easily clickable.

    So, case closed.
    --
    The randomly chosen signature file that would have appeared here is more than 4-ish
    lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/IceCream
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.os.linux.misc on Tue Aug 11 18:47:10 2026
    From Newsgroup: comp.os.linux.misc

    On 11/08/2026 14:59, Marco Moock wrote:
    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it easy for
    her.

    What does that mean?
    Is it a .desktop file with the right content?

    Essentially yes. If you move a launcher to a panel it locates in the ~/.configf tree

    They are not rune by bash, but by xdg

    You can invoke xdg in the command line to test
    --
    There is something fascinating about science. One gets such wholesale
    returns of conjecture out of such a trifling investment of fact.

    Mark Twain

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From pH@wNOSPAMp@gmail.org to comp.os.linux.misc on Wed Aug 12 03:36:32 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-08-11, Nuno Silva <nunojsilva@invalid.invalid> wrote:
    On 2026-08-10, pH wrote:

    Using Linux Mint

    My wife downloads photos from her camera and leaves them in the "Desktop"
    directory.

    I put them where they belong (from a terminal) w/
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    where Beckys_stuff is a directory

    so I thought I'd make a clickable icon on the Desktop to make it easy for
    her.
    the file "move_pictures" contains:
    !/bin/bash,
    mv ~/Desktop/*JPG ~/Desktop/Beckys_stuff/
    mv ~/Desktop/*PDF ~/Desktop/Beckys_stuff/

    I saved it in my 'scripts' directory and and did "chmod +x move_pictures"

    I then created a new launcher on the desktop with the command field filled >> in as: ~/scripts/move_pictures

    But when I click on it I get an error messaage that pops up in a small
    window that says: "There was an error launching the application"

    Every variation I've tried (like removing the !/bin/bash shebang) has led to >> the same message.

    What am I doing wrong?


    I did read the thread so far, but apologies if something was already mentioned and I managed to overlook it:

    1) Is GNU bash installed at (or somehow reachable at) /bin/bash ?

    'tis


    2) Does the script work when you invoke it manually, with no launcher
    involved? I don't mean the commands used, but the script itself, with
    e.g. ./move_pictures.

    Yes.


    (Oh, and: if supported by that implementation of cp, won't you want to
    add -n to the options? (Or perhaps --update=none, which apparently is
    what GNU cp now encourages as a (lengthy?) replacement to -n?)

    To put it in another way: What is your approach to avoid overwriting
    files with the same name?)

    No avoidance. I would be happy to just delete them and I'm 99.99% sure they would never ever be missed or looked for.

    I depend on her Camera sequencing it's photos, but thanks for the reference
    to the -n option for cp...I might add that on.

    I've essentially "closed my ticket" but I see people are still responding, so...

    pH



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From pH@wNOSPAMp@gmail.org to comp.os.linux.misc on Wed Aug 12 03:42:34 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-08-11, Marco Moock <mm@dorfdsl.de> wrote:
    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it easy for
    her.

    What does that mean?
    Is it a .desktop file with the right content?


    A directory of Desktop (ls -a) shows no dot files besides . and ..

    Mint calls them a "launcher" and it appears as an icon on the Desktop if you are graphical.

    pH
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc on Wed Aug 12 04:34:35 2026
    From Newsgroup: comp.os.linux.misc

    On Wed, 12 Aug 2026 03:42:34 -0000 (UTC), pH wrote:

    A directory of Desktop (ls -a) shows no dot files besides . and ..

    Try rCLls -ArCY next time and reduce the clutter.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Nuno Silva@nunojsilva@invalid.invalid to comp.os.linux.misc on Wed Aug 12 09:15:38 2026
    From Newsgroup: comp.os.linux.misc

    On 2026-08-12, pH wrote:

    On 2026-08-11, Marco Moock <mm@dorfdsl.de> wrote:
    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it easy for >>> her.

    What does that mean?
    Is it a .desktop file with the right content?


    A directory of Desktop (ls -a) shows no dot files besides . and ..

    It'd not be a dot file, but a non-dot file with a name ending on
    .desktop.

    Mint calls them a "launcher" and it appears as an icon on the Desktop if you are graphical.

    If you have the failing one around, see if the content is something
    short that you could share here. (IIRC these ought to be plain text?)
    --
    Nuno Silva
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.os.linux.misc on Wed Aug 12 11:28:40 2026
    From Newsgroup: comp.os.linux.misc

    On 12/08/2026 04:42, pH wrote:
    On 2026-08-11, Marco Moock <mm@dorfdsl.de> wrote:
    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it easy for >>> her.

    What does that mean?
    Is it a .desktop file with the right content?


    A directory of Desktop (ls -a) shows no dot files besides . and ..

    Mint calls them a "launcher" and it appears as an icon on the Desktop if you are graphical.

    pH

    And they exist deep inside ~/.config if you move them to a panel from
    the desktop
    --
    rCLIt is hard to imagine a more stupid decision or more dangerous way of making decisions than by putting those decisions in the hands of people
    who pay no price for being wrong.rCY

    Thomas Sowell

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.os.linux.misc on Wed Aug 12 11:35:08 2026
    From Newsgroup: comp.os.linux.misc

    On 12/08/2026 09:15, Nuno Silva wrote:
    On 2026-08-12, pH wrote:

    On 2026-08-11, Marco Moock <mm@dorfdsl.de> wrote:
    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it easy for >>>> her.

    What does that mean?
    Is it a .desktop file with the right content?


    A directory of Desktop (ls -a) shows no dot files besides . and ..

    It'd not be a dot file, but a non-dot file with a name ending on
    .desktop.

    Mint calls them a "launcher" and it appears as an icon on the Desktop if you >> are graphical.

    If you have the failing one around, see if the content is something
    short that you could share here. (IIRC these ought to be plain text?)


    They are, I already posted one and noted that the xdg program invokes
    them - or is invoked by them

    they are xdg config files

    e.g. a home made one - see directory

    ~/.config/mate/panel2.d/default/launchers$ more Mount.desktop

    #!/usr/bin/env xdg-open

    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Icon=/usr/share/icons/Tango/32x32/apps/update-manager.png Icon[en_GB]=/usr/share/icons/Tango/32x32/apps/update-manager.png Name[en_GB]=Mount VPS
    Exec=/usr/local/bin/mount-vps
    Comment[en_GB]=NFS mount our remote servers
    Name=Mount VPS
    Comment=NFS mount our remote servers
    --
    rCLIt is hard to imagine a more stupid decision or more dangerous way of making decisions than by putting those decisions in the hands of people
    who pay no price for being wrong.rCY

    Thomas Sowell

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From c186282@c186282@nnada.net to comp.os.linux.misc on Wed Aug 12 21:44:28 2026
    From Newsgroup: comp.os.linux.misc

    On 8/12/26 04:15, Nuno Silva wrote:
    On 2026-08-12, pH wrote:

    On 2026-08-11, Marco Moock <mm@dorfdsl.de> wrote:
    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it easy for >>>> her.

    What does that mean?
    Is it a .desktop file with the right content?


    A directory of Desktop (ls -a) shows no dot files besides . and ..

    It'd not be a dot file, but a non-dot file with a name ending on
    .desktop.

    Mint calls them a "launcher" and it appears as an icon on the Desktop if you >> are graphical.

    If you have the failing one around, see if the content is something
    short that you could share here. (IIRC these ought to be plain text?)

    Distros vary as to how they handle desktop executables.

    Some - a straight-up link. Others a ".desktop" file with
    a LOT of shit in it, and sometimes you have to use a
    special editor.

    However something you said DID spark a question - WHAT
    editor is the OP using to create the desktop file ???
    LibreOffice Writer ??? It'd all LOOK straight up during
    the creation - but would instead be saved with a mass
    of formatting codes unless you pick just the exact right
    saving format.

    Nano, Mousepad, Featherpad ... those are what you use to
    write yer Bash scripts !

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From c186282@c186282@nnada.net to comp.os.linux.misc on Wed Aug 12 23:23:48 2026
    From Newsgroup: comp.os.linux.misc

    On 8/12/26 06:28, The Natural Philosopher wrote:
    On 12/08/2026 04:42, pH wrote:
    On 2026-08-11, Marco Moock <mm@dorfdsl.de> wrote:
    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it
    easy for
    her.

    What does that mean?
    Is it a .desktop file with the right content?


    A directory of Desktop (ls -a) shows no dot files besides . and ..

    Mint calls them a "launcher" and it appears as an icon on the Desktop
    if you
    are graphical.

    pH

    And they exist deep inside ~/.config if you move them to a panel from
    the desktop

    There are a number of ways these work, depending
    on distro and desktop.

    IMHO there needs to be some AGREEMENT on how such
    things SHOULD work - and the KISS principle should
    be paramount.

    XFCE ... there are ".desktop" files, sometimes hard to
    edit, that include a HUGE amount of "internationalization"
    bullshit. Sometimes I just copy an existing one and then
    brutally change a bunch of the internal stuff.

    Some of the older, simpler, desktops ... they are
    mostly just links. Plain, easy, rules so they Just
    Work.

    Frankly, by trying to make desktop executables "better",
    most have made them much WORSE. Evil M$ operatives ???

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.os.linux.misc on Thu Aug 13 08:26:35 2026
    From Newsgroup: comp.os.linux.misc

    On 13/08/2026 04:23, c186282 wrote:
    On 8/12/26 06:28, The Natural Philosopher wrote:
    On 12/08/2026 04:42, pH wrote:
    On 2026-08-11, Marco Moock <mm@dorfdsl.de> wrote:
    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it
    easy for
    her.

    What does that mean?
    Is it a .desktop file with the right content?


    A directory of Desktop (ls -a) shows no dot files besides . and ..

    Mint calls them a "launcher" and it appears as an icon on the Desktop
    if you
    are graphical.

    pH

    And they exist deep inside ~/.config if you move them to a panel from
    the desktop

    -a There are a number of ways these work, depending
    -a on distro and desktop.

    Yes, but we are talking about Mint MATE specifically
    --
    There is nothing a fleet of dispatchable nuclear power plants cannot do
    that cannot be done worse and more expensively and with higher carbon emissions and more adverse environmental impact by adding intermittent renewable energy.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From vallor@vallor@vallor.earth to comp.os.linux.misc on Thu Aug 13 09:12:17 2026
    From Newsgroup: comp.os.linux.misc

    At Thu, 13 Aug 2026 08:26:35 +0100, The Natural Philosopher <tnp@invalid.invalid> wrote:

    On 13/08/2026 04:23, c186282 wrote:
    On 8/12/26 06:28, The Natural Philosopher wrote:
    On 12/08/2026 04:42, pH wrote:
    On 2026-08-11, Marco Moock <mm@dorfdsl.de> wrote:
    Am 10.08.26 um 01:32 schrieb pH:
    so I thought I'd make a clickable icon on the Desktop to make it
    easy for
    her.

    What does that mean?
    Is it a .desktop file with the right content?


    A directory of Desktop (ls -a) shows no dot files besides . and ..

    Mint calls them a "launcher" and it appears as an icon on the Desktop >>> if you
    are graphical.

    pH

    And they exist deep inside ~/.config if you move them to a panel from
    the desktop

    -a There are a number of ways these work, depending
    -a on distro and desktop.

    Yes, but we are talking about Mint MATE specifically

    XFCE works the same way with panel launcher files -- it's
    all part of the XDG standard, if I'm not mistaken.

    For example:

    _[/home/scott/.config/xfce4/panel/launcher-17]_(scott@lm)EfEo_
    $ cat 17780307091.desktop
    [Desktop Entry]
    Name=Discord
    StartupWMClass=discord
    Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.
    GenericName=Internet Messenger
    Exec=/usr/bin/discord
    Icon=discord
    Type=Application
    Categories=Network;InstantMessaging;
    Path=/usr/bin
    X-XFCE-Source=file:///usr/share/applications/discord.desktop
    --
    -v System76 Thelio Mega v1.1 x86_64 Mem: 258G
    OS: Linux 7.2.0-rc7 D: Mint 22.3 DE: Xfce 4.18 (X11)
    NVIDIA GeForce RTX 3090Ti (24G) (610.57.04)
    "If it's too loud, you're too old."
    --- Synchronet 3.22a-Linux NewsLink 1.2