Question

Please provide a makefile that installs bash and runs a shell script using bash.

Please provide a makefile that installs bash and runs a shell script using bash.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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

  1. Set execute permission on your script:
    chmod +x script-name-here.sh
  2. To run your script, enter:
    ./script-name-here.sh
    OR
    sh script-name-here.sh
    OR
    bash script-name-here.sh

Syntax

The syntax is:
sh file.sh
OR
bash file.sh

How to run .sh file as root user

Some time you need root access to install application; without root, you won’t have the necessary permissions to install application or make system level modifications. Root access is disabled by default on many Linux and UNIX like systems. Simply use the sudo or su command as follows:
sudo bash filename.sh
Type your password. Another option is to use the su command as follows to become superuser:
su -
Type root user password and finally run your script:
bash filename.sh

How to use chmod command to run .sh shell script in Linux

Another recommend option is to set an executable permission using the chmod command as follows:
chmod +x file.sh
Now your can run your .sh file as follows
./file.sh
/path/to/file.sh

How do I run .sh file named install.sh?

Just run the following two command:
chmod +x install.sh
./install.sh
The dot (.) refers to the current working directory. The install.sh is in the current directory so you run it as above or as follows too:
bash install.sh
OR
sh install.sh

Add a comment
Know the answer?
Add Answer to:
Please provide a makefile that installs bash and runs a shell script using bash.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT