Sponsored Content
Top Forums Shell Programming and Scripting Need help make pkgadd command Non-Interactive Post 302990916 by mohtashims on Thursday 2nd of February 2017 07:34:16 PM
Old 02-02-2017
Need help make pkgadd command Non-Interactive

i use this command to make pkgadd non-interactive.
Command1:
Code:
echo | sudo /usr/sbin/pkgadd -n -a /u/base/admin -r silent.txt -d /tmp/dbs.pkg

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:
Code:
echo 'mypasswordxxx' | sudo -S /usr/sbin/pkgadd -n -a /u/base/admin -r silent.txt -d /tmp/dbs.pkg

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 ----------
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to make a cshell (csh) script interactive

Experts, I tried to make my cshell script interactive by asking the user for password and trying to read the input using the "read" command. I have been unsuccessful so far. Do you have any idea ? Thanks Jim (2 Replies)
Discussion started by: jimmynath
2 Replies

2. UNIX for Advanced & Expert Users

SU command in non interactive mode

Can i run the SU command in a non interactive mode. What i want to do is to pass the username and the password as commandline or batch parameters. Please let me if its possible and how to pass them. A sample file will be appreciated. Thanks, (6 Replies)
Discussion started by: rohitag
6 Replies

3. Shell Programming and Scripting

How to make interactive shell script a automated one?

Hi, I am new to shell scripting.I have written a very simple shell scipt that asks for the username and password on executing. i.e echo "Enter username :" read usrname; echol "Enter password :"; read passwd; echo usrname; echo passwd; but now I want to make it automatic , such... (2 Replies)
Discussion started by: bhaskar_m
2 Replies

4. UNIX for Dummies Questions & Answers

nohup has a terrible bad performance compared with interactive command, why?

I have a strange situation. I'm running a shell script containing several data uploads (using Oracle sqlloader utility). This script is being run on a Red Hat server. I tried to run it in background: $ nohup upload.sh & This script uploads some thousands files. After several hours I... (0 Replies)
Discussion started by: viniciov
0 Replies

5. Homework & Coursework Questions

How to write script that behaves both in interactive and non interactive mode

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (8 Replies)
Discussion started by: rits
8 Replies

6. AIX

Non interactive command output using script command ?

Hello, Script command helps to save command output to file. (Redicection doesn't work in this case). Besides interactive shell 'recording', Linux script command has "-c" option which allows to record output of some non-interactive command. The problem is that AIX script command variant... (6 Replies)
Discussion started by: vilius
6 Replies

7. Shell Programming and Scripting

How to make command line interactive?

I have a file with stats for different month, I use the cat and grep combination to search for different month. cat <file> | grep "April" cat <file> | grep "May" cat <file> | grep "June" etc. How do you make this command interactive. So that I can give the values for the search. Thanks... (7 Replies)
Discussion started by: purelltab
7 Replies

8. Shell Programming and Scripting

Expect command use for interactive mode of scripting

Hi All, I am writing a script(Auto_Installation.sh) which is calling one another script (./update_manager /spare/install/HO7/PME_Response_file.txt) Now the issue is result of (./update_manager /spare/install/HO7/PME_Response_file.txt) script is ##########################################... (6 Replies)
Discussion started by: Dhruvak
6 Replies

9. Shell Programming and Scripting

Shell script using an interactive command

Hello experts, I have a to write script for monitoring, the script would use a command and I plan to write the script as follows while true do command -arg sleep 2 clear done The output would be set up on a screen for monitoring. However the issue is that the command used in... (2 Replies)
Discussion started by: maverick_here
2 Replies

10. Shell Programming and Scripting

Non-interactive pkgadd not working.

Inorder to make the pkgadd non-interactive i tried couple of things but both failed. 1. sudo pkgadd -n /u/mont/admin -d /u/mont/dbprd.pkg pkgadd: ERROR: no packages were found in </var/spool/pkg> 2. yes all | sudo pkgadd -a /u/mont/admin -d /u/mont/dbprd.pkg ... (0 Replies)
Discussion started by: mohtashims
0 Replies
dop(8)							      System Manager's Manual							    dop(8)

NAME
dop - Allows a user to execute a privileged program without knowing the root password. The dop command also modifies the action database. SYNOPSIS
/usr/sbin/dop [-n | -N] [ui:] action [args] /usr/sbin/dop -a priv[,priv]... action [ui:]pathspec[,[ui:]pathspec]... /usr/sbin/dop -a priv[,priv]... [ui:]pathspec /usr/sbin/dop -d action /usr/sbin/dop [-w | -W] OPTIONS
Invokes a prompt asking the user if they want to run the command as a user or as root. The root password is required to run as root. Attempts to run the action with the user privileges. Adds new actions to the dop database. Deletes an existing action from the dop data- base. Writes a binary image without changing the source. Updates the actionlist from the dop action file and then executes the -w option, which writes the binary image. OPERANDS
Name of privileged program to invoke Arguments to pass to the application guarded by the privilege. Comma separated privilege list (see sysman dopconfig) The fully qualified path name and arguments for the associated action. When specified by a comma separated pathlist and arguments for multiple user interface domains (ui:), the first ui: argument speci- fied is used as the default. If no action is specified, then the path base name is used. A run-time argument replaces the first occurrence of asterisk as a word (for example *) in a string, or else they are ignored. Path arguments should be quoted per the cur- rent shell. Optional. A user interface domain, typically one of X11, suit, java, menu, cui, or cli. DESCRIPTION
The dop (Division of Privileges) command can execute an action after proper authentication from the privilege database file. For more information, see the Security guide. RESTRICTIONS
You must have root privileges to modify the privileges database. EXAMPLES
The following example will add an action to the AccountManagement privilege. dop -a AccountManagement adduser_script /usr/sbin/adduser The following example runs the action adduser_script for the AccountManagement privilege. dop adduser_script The following example deletes the adduser_script action from the action database. dop -d adduser_script FILES
Executable file. Executable file for adding or deleting permissions for users and or groups. dop database. SEE ALSO
Commands: sysman(8) dop(8)
All times are GMT -4. The time now is 02:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy