Whenever I download an .sh-file gedit opens up and then freezes. Why?
2 Answers
If gedit
opens up after the download is complete, that's because your browser is set up to open downloaded files automatically and to open them in the system's default application.
If gedit
opens up because you double-clicked on the .sh
file in nautilus
, that's because of the default behavior of nautilus
, which is to open .sh
files in the system's default text editor rather than to run them.
To change nautilus
' default behavior:
- Open Files from the Unity Launcher
- On the Unity Panel, click on "Edit" > "Preferences"
- Select the "Behavior" tab and under "Executable Text Files" select "Run executable files when they are opened" and click on the "Close" button.
On why gedit
freezes, it might be that the .sh
file is very long.
If the .sh
is not very long, it might be that it is encoded with some exotic encoding that gedit
cannot handle.
If the .sh
file is not encoded with any exotic encoding, try to reinstall / update gedit by running this command in a Terminal: sudo apt-get remove gedit && sudo apt-get update && sudo apt-get install gedit
-
1Thanks! Wouldn't it be a lot more intuitive for us newbies if Ubuntu did run .sh files per default? Apr 21, 2015 at 13:13
sh
files aren't double-click executables; they need to be run from the terminal. (/path/to/script.sh
) sh
files can also be big. More than 10MB of text is sure to freeze up any text program for a while, until it can load all of the text.
-
1
-
-
Come on,
gksudo
is just as dangerous. It's about to run the script with superuser privileges without it to see before.– A.B.Apr 20, 2015 at 15:54 -
-