You are not logged in.

#1 2026-04-11 02:25:23

inxcvizor
Member
Registered: 2026-02-19
Posts: 20

bash file wont run properly

Everytime I wanted to run a bash file from terminal, it just dispolays an error message

"Warning: Could not find '(file location)', starting '/usr/bin/bash' instead.  Please check your profile settings."

Can anyone help me?

Offline

#2 2026-04-11 03:22:43

sukolyn
Member
Registered: 2024-02-14
Posts: 155

Re: bash file wont run properly

show not working code.

Offline

#3 2026-04-11 06:39:27

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 74,647

Re: bash file wont run properly

Show rather its stat - the file probably lacks the executable bit.

Offline

#4 2026-04-11 09:32:38

inxcvizor
Member
Registered: 2026-02-19
Posts: 20

Re: bash file wont run properly

seth wrote:

Show rather its stat - the file probably lacks the executable bit.

I do not know what a "stat" is, I'm very sorry, therefore i'll show you the code:

#!/usr/bin/bash
# fullname="USER INPUT"
read -p "Enter fullname: " fullname
# user="USER INPUT"
read -p "Enter user: " user

The code is just to test the read command

Last edited by inxcvizor (2026-04-11 09:33:43)

Offline

#5 2026-04-11 10:00:56

5hridhyan
Member
From: Asia
Registered: 2025-12-25
Posts: 558

Re: bash file wont run properly

I do not know what a "stat" is

a command, shows detailed info about a file (like who owns it and what permissions it has)

Edit:
https://man.archlinux.org/man/stat.1

Last edited by 5hridhyan (2026-04-11 10:06:48)


---

Offline

#6 2026-04-11 13:40:59

GerBra
Forum Fellow
From: Bingen/Germany
Registered: 2007-05-10
Posts: 261

Re: bash file wont run properly

@inxcvizor: How exactly are you trying to start the script?
Are you using Plasma/KDE ? And Dolphin as Filemanager?

I got the same message in an "empy" konsole(bash) when the script is not executable, when i start it in Dolphin via Actions->Run in konsole

stat --format='%a %A' test.sh 
644 -rw-r--r--

Journal says:

Apr 11 15:09:39 ws01 systemd[3084]: Started konsolerun.
Apr 11 15:09:39 ws01 konsole[24833]: "Programmdatei kann nicht gefunden werden: " "/home/gerhard/test.sh"   MEANS: program could not be found
Apr 11 15:09:39 ws01 konsole[24833]: "Programmdatei kann nicht gefunden werden: " "/home/gerhard/test.sh"
Apr 11 15:09:39 ws01 systemd[3084]: Started app-org.kde.konsole-24833.scope.

This makes IMHO sense, cause it's not executable.

If i make it executable

stat --format='%a %A' test.sh 
755 -rwxr-xr-x

Dolphin give another start option:
"Ausführbare Datei starten" means: Start executable file


And now it gets a bit real "fishy" here:
-a) Starting it via Start executable file does "nothing", only in journal:

Apr 11 15:26:05 ws01 systemd[3084]: Started /home/gerhard/test.sh.
Apr 11 15:26:05 ws01 systemd[3084]: app-\x2fhome\x2fgerhard\x2ftest.sh@114ef1a838194c8c9d57a54189e3594d.service: Main process exited, code=exited, status=1/FAILURE
Apr 11 15:26:05 ws01 systemd[3084]: app-\x2fhome\x2fgerhard\x2ftest.sh@114ef1a838194c8c9d57a54189e3594d.service: Failed with result 'exit-code'.

Ok, maybe //edit because test.sh is not getting started in a Terminal (konsole,...)

-b) Starting this via Actions->Run in konsole
1. This starts the script, make the two read's, BUT never terminates (even not with an exit in shell script)! Journal:

Apr 11 15:29:23 ws01 systemd[3084]: Started konsolerun.
Apr 11 15:29:23 ws01 systemd[3084]: Started app-org.kde.konsole-25305.scope.

I could even not terminate it with CTRL-C.

Although/Cause all so called "apps" meanwhile get run through systemd.services(wtf), i would say this should be NOT the normal, expected behavior with shell scrips in Plasma/Dolhin/systemd.

@inxcvizor:
This/Your script runs fine when started in an open Terminal, either:
a) if the script has no executable bits set

bash -e test.sh

or, if executable:

./test.sh

Last edited by GerBra (2026-04-11 13:49:16)


My avatar: "It's not just a toilet... a FERGUSON. The King of bowls. Sit down and give me your best shot." Al Bundy

Offline

#7 2026-04-11 14:11:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 74,647

Re: bash file wont run properly

The error is a known bash peculiarity (irritating everyone on first encounter) - better™ shells will tell you

◉ LC_ALL=C ./test.sh                    
zsh: permission denied: ./test.sh

-b) Starting this via Actions->Run in konsole
1. This starts the script, make the two read's, BUT never terminates (even not with an exit in shell script)! Journal:

This will likely run "konsole --hold -e test.sh", https://docs.kde.org/stable_kf6/en/kons … tions.html
Otherwise the script would terminate and konsole close.
What you're probably is expecting to be able to drop into an interactive shell, but that doesn't just happen - your script could end w/ "exec bash"

Offline

#8 2026-04-11 14:21:50

GerBra
Forum Fellow
From: Bingen/Germany
Registered: 2007-05-10
Posts: 261

Re: bash file wont run properly

> This will likely run "konsole --hold -e test.sh"

Yeah, i saw it currently in process list. The script terminates fine, you have to close the Terminal where it was running with STRG+SHIFT+W.

I'm new in Plasma and Dolphin as a filemanager, and i would never want to start my scripts via this way...

So, sorry for the noise.

Best solution for @inxcvizor IMHO.
a) make your script executable
b) start it in an open terminal as mentioned above, this give you easier control for running a script.
c) if you use dolphin (i assumed it), run the script via Actions->Run in console.


My avatar: "It's not just a toilet... a FERGUSON. The King of bowls. Sit down and give me your best shot." Al Bundy

Offline

#9 2026-04-15 13:50:28

inxcvizor
Member
Registered: 2026-02-19
Posts: 20

Re: bash file wont run properly

GerBra wrote:

c) if you use dolphin (i assumed it), run the script via Actions->Run in console.

I'm sorry, but how do you do that?

Offline

#10 2026-04-15 15:43:32

GerBra
Forum Fellow
From: Bingen/Germany
Registered: 2007-05-10
Posts: 261

Re: bash file wont run properly

Right click on the script you want to run.
In the context menu you should have a entry named "Actions". Therein is the entry: Run/start in konsole (my plasma-Language is German, so i could not 100% correctly name the entries in English).

As mentioned, the script must be executable and the opened konsole window stays open, even when the script is finished. If you work/test on a script this is IMHO a bad way to start the script.


My avatar: "It's not just a toilet... a FERGUSON. The King of bowls. Sit down and give me your best shot." Al Bundy

Offline

#11 2026-04-16 12:07:22

inxcvizor
Member
Registered: 2026-02-19
Posts: 20

Re: bash file wont run properly

It just displays the aforementioned error message

Offline

#12 2026-04-16 12:51:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 74,647

Re: bash file wont run properly

What's the output of

stat /path/to/your/script.sh
findmnt -T /path/to/your/script.sh

Offline

#13 2026-04-18 11:02:20

inxcvizor
Member
Registered: 2026-02-19
Posts: 20

Re: bash file wont run properly

stat =

  File: /home/lecomputer/Documents/bashStuff/tesprogramme.sh
  Size: 124             Blocks: 8          IO Block: 4096   regular file
Device: 8,2     Inode: 11868186    Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/lecomputer)   Gid: ( 1000/lecomputer)
Access: 2026-04-18 17:57:28.043732577 +0700
Modify: 2026-04-10 21:17:03.952370853 +0700
Change: 2026-04-10 21:17:03.952370853 +0700
 Birth: 2026-04-10 21:04:25.721529808 +0700

findmnt =

TARGET SOURCE    FSTYPE OPTIONS
/      /dev/sda2 ext4   rw,relatime

Offline

#14 2026-04-18 12:09:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 74,647

Re: bash file wont run properly

Well…

chmod +x /home/lecomputer/Documents/bashStuff/tesprogramme.sh

Offline

Board footer

Powered by FluxBB