You are not logged in.

#1 2025-05-04 06:17:01

raxmax
Member
Registered: 2025-04-09
Posts: 25

[SOLVED] Konsole displays an error whenever I run a .sh file in it.

I'm a KDE plasma user and I'm having a bit of trouble.
I have .sh files but when I right click on them and select "Run In Konsole", it displays an error like this:

Warning: Could not find '/home/username/Desktop/filename.sh', starting '/usr/bin/bash' instead.  Please check your profile settings.

I have gone to settings, created a new profile (because I can't edit the Built-In one), set "Command" to

/bin/bash

but is still shows the same error.
How do I fix this? I'm a bit of a newbie.

Last edited by raxmax (2025-05-06 13:30:50)

Offline

#2 2025-05-04 12:50:45

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,756

Re: [SOLVED] Konsole displays an error whenever I run a .sh file in it.

stat /home/username/Desktop/filename.sh # I suspect it's not executable?
file /home/username/Desktop/filename.sh

Offline

#3 2025-05-04 17:54:48

raxmax
Member
Registered: 2025-04-09
Posts: 25

Re: [SOLVED] Konsole displays an error whenever I run a .sh file in it.

seth wrote:
stat /home/username/Desktop/filename.sh # I suspect it's not executable?
file /home/username/Desktop/filename.sh

This is the result of those commands: https://ibb.co/N6MY64N3

Offline

#4 2025-05-04 18:38:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,076

Re: [SOLVED] Konsole displays an error whenever I run a .sh file in it.

Please just past text as text in the future.

In any case - as seth suspected - your .sh file is not executable, and also lacks a shebang to define it as a shell script to run. To fix the first issue chmod +x your scripts that you intend to be executable, for the second problem add

#!/bin/bash

or so as the very first line of the shell script

Last edited by V1del (2025-05-04 18:39:25)

Offline

#5 2025-05-05 13:17:37

raxmax
Member
Registered: 2025-04-09
Posts: 25

Re: [SOLVED] Konsole displays an error whenever I run a .sh file in it.

V1del wrote:

Please just past text as text in the future.

In any case - as seth suspected - your .sh file is not executable, and also lacks a shebang to define it as a shell script to run. To fix the first issue chmod +x your scripts that you intend to be executable, for the second problem add

#!/bin/bash

or so as the very first line of the shell script

Thanks! This fixed the error

Offline

#6 2025-05-05 13:20:22

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,756

Re: [SOLVED] Konsole displays an error whenever I run a .sh file in it.

\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB