This works fine if i run it as root user but when i run it with non-root user it prompts me for the password and then executes successfully thus making it "INTERACTIVE".
I know how to provide the password on the fly like below.
Command2:
How can i combine Command1 and Command2 to make it run as non-root and install successfully without any prompt i.e no prompt for password for sudo and no prompt for pkgadd .
Note: I would prefer not to change the profile settings.
Kindly suggest.
---------- Post updated at 07:34 PM ---------- Previous update was at 05:21 PM ----------
Unfortunately, i made the changes without the absolute path and now my sudoers file is corrupt.
sudo vi /etc/sudoers
>>> /etc/sudoers: syntax error near line 117 <<<
sudo: parse error in /etc/sudoers near line 117
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
I am still logged on to the box but the sudo commands fail with the error msg above.
This is why you use visudo, not sudo vi to edit /etc/sudoers.
There was probably a warning in the file telling you such, like there is in mine:
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##
Now you will need real root access to fix it.
sudo may have had security features preventing you from raw editing it anyway - it might not work again, even fixed, until you run visudo and re-save from root.
Log in with the username 'root' and root's password. This usually can't be done over ssh, only over a local terminal.
If you have a user with administrative privileges (meaning can change from system to system, membership in the 'wheel' group is sometimes sufficient) you can 'su - root', type in root's password, and login as root. This is an actual login, and does not involve sudo, or require a local terminal.
I am sorry to say it but it seems that you lack so many basic fundamental things working with Unix/Linux and it also seems that all those really many threads of yours in the forum and all the answers you got, do not change a bit to that fact.
You might want to take a basic lesson in administering a system.
Because of this, I will set your account to read-only for 3 months so you have time to catch up a bit.