Skip to content

Latest commit

 

History

History
86 lines (52 loc) · 2.54 KB

README.md

File metadata and controls

86 lines (52 loc) · 2.54 KB

How do I run .sh file shell script in Linux?

How do I Install dialog command?

Bash Image

The procedure to run the .sh file shell script on Linux is as follows:

--

Set execute permission on your script:

chmod +x script-name-here.sh

To run your script, enter:

./script-name-here.sh

or

sh script-name-here.sh

or

bash script-name-here.sh

Install dialog command

install dialog bash

Type the following command to install the dialog command line utility under Debian or Ubuntu Linux:

First Of All Use

  • sudo apt-get update install dialog bash

After That For:

Ubuntu

  • sudo apt-get install dialog

Debian

  • apt-get install dialog

Red hat

  • yum install dialog

Suse

  • zypper install dialog

install dialog bash

GUI method to run .sh file

Select the file using mouse. Right-click on the file. Choose Properties:

Bash Image

Click Permissions tab. Select Allow executing file as a program:

Bash Image

Now click the file name and you will be prompted. Select “Run in the terminal” and it will get executed in the terminal.

How do I run .sh in Windows ?

Execute Shell Script using Ubuntu on Windows 10

Make sure you have Ubuntu or any other Linux distros installed. Ubuntu will mount or make all your Windows directories available under /mnt. So the C drive is available at /mnt/C. So if the desktop will be available at /mnt/c/users//desktop.

Bash Image

--

Now follow these steps

  • Launch Ubuntu or any other Linux distros installed.
  • Navigate to the folder using “cd” command to the folder where the scripts are available. (use cd and ls commands)
  • Type “./zmones.sh" or "sh zmones.sh" or "bash zmones.sh” and hit enter.

zmones.sh i mean eq ==> zmones_LTU.sh or zmones_ENG.sh

It will execute the script, and if they have a dependency on any of core Linux features.

How it locks like

Bash Image

Bash Image