How to execute Shell commands in GNU/Linux

Issue

This Content is from Stack Overflow. Question asked by Ommadawn

I am creating a Web using JavaEE + Tomcat, and I would like to know what would be the best way to execute a GNU/Linux Shell command and, if possible, to know if there has been an error in the execution of the command.

How to manage if it is an administrative command for which I must have root permissions to execute it? For example, how to execute the following command that I normally execute as follows in the Shell:

#bash ~/my_script.sh

(with root permissions)

Thanks.



Solution

check the solution

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?