On the other hand if you run the script itself, the system calls out to the interpreter. When writing shell programs, we often use /bin/sh and /bin/bash. Whenever i open a.sh file, it opens it in gedit instead of the terminal.
Josh Segarra Filmaffinity
./file will execute the file in the current directory. I usually use bash, but i don't know what's the difference between them. The sh utility is a command language interpreter that shall execute commands read from a command line string, the.
Sudo sh this command runs sh as a super user.
What's the main difference between bash and sh? How do i open this file. I can't find any option similar to right click → open with → other application. The sh interpreter is opening the file.
So you need to run it from a linux console, just typing its name the same you do. Sh files are unix (linux) shell executables files, they are the equivalent (but much more powerful) of bat files on windows. The file can be a binary. .sh file is nothing but the shell script to install given application or to perform other tasks under unix like operating systems.
The easiest way to run.sh shell script in linux or unix is to type the following.
For example this would look like the process 'sh' with the argument 'filename.sh'. See how to enable root account.