Re: Need help with shell script.

pH <[email protected]>
Newsgroups comp.os.linux.misc
Organization A noiseless patient Spider
Message-ID <[email protected]>
On 2026-08-11, Nuno Silva <[email protected]> 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


>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.