Cant ./file.sh but can sh file.sh

I chmoded the file and can’t ./file.sh but sh file.sh and bash file.sh both work… Any ideas?

What OS?

chmod +x file.sh didn’t work?

Do you have a shebang on the first line?

#!/bin/bash or the likes?

Is the file on a noexec volume? I.e. vfat/exfat ones or thumbdrives in general tend to automount as noexec.

You can see this with mount command.

This is what it is.

sh instead of bash.

popos.

Got it working. whatever the issue was, i mounted it (auto) via disks utility and not command line in fstab. Maybe just the restart fixed it. idk.

That’s strange. Must have been mounted with noexec flag.

Gnome has some strange visions…

properties were defaults.

Sounds like good security practice to me. Executables should be in your base OS disk, not on external media, 99.999% of the time in 2021.

So home directories for users?