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


Groups > comp.os.linux.misc > #89824 > unrolled thread

Need help with shell script.

Started bypH <wNOSPAMp@gmail.org>
First post2026-08-09 23:32 +0000
Last post2026-08-11 08:56 +0100
Articles 20 — 11 participants

Back to article view | Back to comp.os.linux.misc


Contents

  Need help with shell script. pH <wNOSPAMp@gmail.org> - 2026-08-09 23:32 +0000
    Re: Need help with shell script. Eli the Bearded <*@eli.users.panix.com> - 2026-08-10 01:01 +0000
      Re: Need help with shell script. c186282 <c186282@nnada.net> - 2026-08-10 00:23 -0400
        Re: Need help with shell script. pH <wNOSPAMp@gmail.org> - 2026-08-10 05:04 +0000
          Re: Need help with shell script. rbowman <bowman@montana.com> - 2026-08-10 05:44 +0000
            Re: Need help with shell script. pH <wNOSPAMp@gmail.org> - 2026-08-10 19:22 +0000
          Re: Need help with shell script. The Natural Philosopher <tnp@invalid.invalid> - 2026-08-10 12:12 +0100
            Re: Need help with shell script. vallor <vallor@vallor.earth> - 2026-08-10 11:38 +0000
            Re: Need help with shell script. "Stanislav N. aka pztrn" <pztrn@oldproto.invalid> - 2026-08-10 16:40 +0500
              Re: Need help with shell script. pH <wNOSPAMp@gmail.org> - 2026-08-10 19:27 +0000
              Re: Need help with shell script. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-10 23:58 +0000
                Re: Need help with shell script. Farley Flud <ff@gnulinux.rocks> - 2026-08-11 00:19 +0000
        Re: Need help with shell script. "Stanislav N. aka pztrn" <pztrn@oldproto.invalid> - 2026-08-10 16:31 +0500
          Re: Need help with shell script. c186282 <c186282@nnada.net> - 2026-08-10 21:14 -0400
      Re: Need help with shell script. pH <wNOSPAMp@gmail.org> - 2026-08-10 04:59 +0000
        Re: Need help with shell script. rbowman <bowman@montana.com> - 2026-08-10 05:41 +0000
        Re: Need help with shell script. pH <wNOSPAMp@gmail.org> - 2026-08-10 19:17 +0000
          Re: Need help with shell script. gazelle@shell.xmission.com (Kenny McCormack) - 2026-08-10 20:08 +0000
    Re: Need help with shell script. Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-10 01:36 +0000
    Re: Need help with shell script. Nuno Silva <nunojsilva@invalid.invalid> - 2026-08-11 08:56 +0100

#89824 — Need help with shell script.

FrompH <wNOSPAMp@gmail.org>
Date2026-08-09 23:32 +0000
SubjectNeed help with shell script.
Message-ID<115b2mq$2natp$1@dont-email.me>
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

[toc] | [next] | [standalone]


#89826

FromEli the Bearded <*@eli.users.panix.com>
Date2026-08-10 01:01 +0000
Message-ID<eli$2608092059@qaz.wtf>
In reply to#89824
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

[toc] | [prev] | [next] | [standalone]


#89835

Fromc186282 <c186282@nnada.net>
Date2026-08-10 00:23 -0400
Message-ID<2e-dnb0tLsiBz-T3nZ2dnZfqnPednZ2d@giganews.com>
In reply to#89826
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.

[toc] | [prev] | [next] | [standalone]


#89838

FrompH <wNOSPAMp@gmail.org>
Date2026-08-10 05:04 +0000
Message-ID<115bm5q$2s4o9$2@dont-email.me>
In reply to#89835
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

[toc] | [prev] | [next] | [standalone]


#89843

Fromrbowman <bowman@montana.com>
Date2026-08-10 05:44 +0000
Message-ID<ndt6q3FsvrcU2@mid.individual.net>
In reply to#89838
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?

[toc] | [prev] | [next] | [standalone]


#89859

FrompH <wNOSPAMp@gmail.org>
Date2026-08-10 19:22 +0000
Message-ID<115d8dq$3d7jb$2@dont-email.me>
In reply to#89843
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

[toc] | [prev] | [next] | [standalone]


#89849

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2026-08-10 12:12 +0100
Message-ID<115cbn8$323nr$2@dont-email.me>
In reply to#89838
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

[toc] | [prev] | [next] | [standalone]


#89853

Fromvallor <vallor@vallor.earth>
Date2026-08-10 11:38 +0000
Message-ID<115cd7p$32kkn$4@dont-email.me>
In reply to#89849
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."

[toc] | [prev] | [next] | [standalone]


#89854

From"Stanislav N. aka pztrn" <pztrn@oldproto.invalid>
Date2026-08-10 16:40 +0500
Message-ID<115cdc7$c8c$1@inn.news.oldproto.ru>
In reply to#89849
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.

[toc] | [prev] | [next] | [standalone]


#89860

FrompH <wNOSPAMp@gmail.org>
Date2026-08-10 19:27 +0000
Message-ID<115d8mk$3d7jb$3@dont-email.me>
In reply to#89854
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

[toc] | [prev] | [next] | [standalone]


#89863

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-10 23:58 +0000
Message-ID<115dojp$3i42e$4@dont-email.me>
In reply to#89854
On Mon, 10 Aug 2026 16:40:56 +0500, Stanislav N. aka pztrn wrote:

> 1. Script has no executable bit set.

Error message: “permission denied”.

“But it’s MY FILE! I created it, it belongs to me, I have full access
over it! What possible ‘permission’ am I being denied?”

Answer: execute access.

[toc] | [prev] | [next] | [standalone]


#89865

FromFarley Flud <ff@gnulinux.rocks>
Date2026-08-11 00:19 +0000
Message-ID<18ca9837cbed8bc3$139504$704772$802601b3@news.usenetexpress.com>
In reply to#89863
On Mon, 10 Aug 2026 23:58:49 -0000 (UTC), Lawrence D’Oliveiro wrote:

> 
> “But it’s MY FILE! I created it, it belongs to me, I have full access
> over it! What possible ‘permission’ am I being denied?”
> 
> 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?

[toc] | [prev] | [next] | [standalone]


#89852

From"Stanislav N. aka pztrn" <pztrn@oldproto.invalid>
Date2026-08-10 16:31 +0500
Message-ID<115ccr2$c7k$1@inn.news.oldproto.ru>
In reply to#89835
10.08.2026 09:23, c186282 wrote:
>    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.

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.

[toc] | [prev] | [next] | [standalone]


#89868

Fromc186282 <c186282@nnada.net>
Date2026-08-10 21:14 -0400
Message-ID<e9OcnQrACK3t6uf3nZ2dnZfqn_udnZ2d@giganews.com>
In reply to#89852
On 8/10/26 07:31, Stanislav N. aka pztrn wrote:
> 10.08.2026 09:23, c186282 wrote:
>>    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.
> 
> 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.

   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() {
>          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.

[toc] | [prev] | [next] | [standalone]


#89837

FrompH <wNOSPAMp@gmail.org>
Date2026-08-10 04:59 +0000
Message-ID<115blrg$2s4o9$1@dont-email.me>
In reply to#89826
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

[toc] | [prev] | [next] | [standalone]


#89842

Fromrbowman <bowman@montana.com>
Date2026-08-10 05:41 +0000
Message-ID<ndt6k1FsvrcU1@mid.individual.net>
In reply to#89837
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 ?

[toc] | [prev] | [next] | [standalone]


#89858

FrompH <wNOSPAMp@gmail.org>
Date2026-08-10 19:17 +0000
Message-ID<115d841$3d7jb$1@dont-email.me>
In reply to#89837
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

[toc] | [prev] | [next] | [standalone]


#89861

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2026-08-10 20:08 +0000
Message-ID<115db3f$1qq3p$1@news.xmission.com>
In reply to#89858
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.

[toc] | [prev] | [next] | [standalone]


#89827

FromLawrence D’Oliveiro <ldo@nz.invalid>
Date2026-08-10 01:36 +0000
Message-ID<115b9vf$2p9mf$1@dont-email.me>
In reply to#89824
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.

[toc] | [prev] | [next] | [standalone]


#89872

FromNuno Silva <nunojsilva@invalid.invalid>
Date2026-08-11 08:56 +0100
Message-ID<115ekju$3p2b3$3@dont-email.me>
In reply to#89824
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.linux.misc


csiph-web