6

They will only open in a text editor. "Open With" doesn't offer an option to execute. The shell scripts are +x so they should run normally.

As a workaround, I set them to be opened with the terminal emulator, but it is not ideal.

  • 1
    It's different question since it's about XFCE and the answers are all about Gnome and nautilus. – jcubic Jan 14 '17 at 20:33
  • 1
    The answer about Thunar is here. – Marco Apr 18 '17 at 14:20
  • @Marco- Also, here on how to achieve the purpose with custom actions in Thunar (without re-enabling that "risky" feature). – cipricus Sep 02 '19 at 12:40
  • You can make .sh files execute on double click without a terminal window by right click on a file -> Open With Other Application -> Use custom command -> type "bash" in the input field then tick "Use as default for this kind of file", and press "Open" – Klesun Nov 30 '19 at 17:40

1 Answers1

-1

Even when marked as executable, the system doesn't know what to use to interpret the script. If it is a POSIX shell script, add this line to the very beginning of your script:

#!/bin/sh

Should it require bash or some other shell, use e.g. for bash

#!/bin/bash

The same applies to other executable text files, such as python programs:

#!/usr/bin/python
s3lph
  • 14,314
  • 11
  • 59
  • 82