sh file.sh
OR
bash file.sh
.sh File As Root User
Sometime you need to install application which requires root level privalage
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 sudo or su 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
chmod Command: Run 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
Source: http://www.cyberciti.biz/faq/run-execute-sh-shell-script/
No comments:
Post a Comment