Sponsored Content
Top Forums UNIX for Advanced & Expert Users Automate Script using pkgrm/pkgadd commands Post 302240634 by Insight on Friday 26th of September 2008 07:21:02 AM
Old 09-26-2008
I finally found the solution to this problem by doing a simple 'trick'.

pkgadd has an -a option which allows to use your own admin file to control the process. The format of this file is similar to the one below.

instance=overwrite
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=nocheck
setuid=nocheck
conflict=nocheck
action=nocheck
basedir=default

The 'action=nocheck' line tells to the command to bypass the questions in order to automate the execution.

The problem is that the first question which needs an 'all' answer (instead of 'y') cannot be bypassed by this command.

What I did was to create two files. The first one had the above 'admin file' structure and the second one had only one line with the word 'all'.

echo "mail=
instance=overwrite
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=nocheck
setuid=nocheck
conflict=nocheck
action=nocheck
basedir=default" > $NOASK_FILE

echo "all" > $INPUT_FILE


By using the following command:


pkgadd -a $NOASK_FILE -d [package-path] < $INPUT_FILE

the package was added automatically without any user interaction.

I hope this helps others that will face the same issue in the future.

Thanks for your replies.
This User Gave Thanks to Insight For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

pkgrm

Hello, How can I list the installed packages on my Solaris 10 ? Regards :confused: (7 Replies)
Discussion started by: XNOR
7 Replies

2. Shell Programming and Scripting

here document to automate perl script that call script

I am trying to use a here document to automate testing a perl script however when the perl script hits a system(perl subscript.pl) call, input is no longer entered into this subscript. here is my script $ cat test.sh #ksh for testcase do program <<-EOF | tee -a funcscnlog.log y... (3 Replies)
Discussion started by: hogger84
3 Replies

3. Solaris

pkgrm without removing the dependent packages

Hi all, Is there any option to remove a package without removing the dependent packages.... ie, i need to remove a package, while trying to remove by using pkgrm command it says as some dependent packages also will get removed, i dont want to remove those dependent packages. (1 Reply)
Discussion started by: judi
1 Replies

4. UNIX for Advanced & Expert Users

Shell Script to Automate

I would like to automate script where i do not have to manually insert the username and password I wrote two different scripts but not able to achieve the results: here's to scripts i wrote #!/bin/bash cd /var/tmp /home/server/steve/pca --askauth -idx /opt/app/bin/expect <<EOF expect... (1 Reply)
Discussion started by: sam786
1 Replies

5. Shell Programming and Scripting

How can I automate a script?

Hi All, Can I automate a script when some one trying to 'vi' (open) a file. For Example, I am having a file named 'SecuredShell.sh'. when a user types " vi SecuredShell.sh " in unix command prompt a script named secure.sh needs to be automated. Can this be possible. if Yes please guide... (2 Replies)
Discussion started by: little_wonder
2 Replies

6. Shell Programming and Scripting

Automate remote script

Hi all, I need to execute a script on a remote machine that are connected to the network.The basic requirement is to write a script which will login in remote machine and then execute the other script automatically placed in remote machine.So that I need to execute the remote machine script... (3 Replies)
Discussion started by: smartgupta
3 Replies

7. Windows & DOS: Issues & Discussions

automate the script

Dear all, I I want to login to my Linux machine using putty and then run some script from Windows machine.we can do it after loging it and then execute the script by typing it in putty command line screen. but I want to automate it.So whenever I will fire this script,it will do the following... (4 Replies)
Discussion started by: smartgupta
4 Replies

8. Shell Programming and Scripting

Need Help with commands to automate.

HI, In some test cases, I used tools like "dd" and "shed" to manually read a block from the disk, modify it using a hex editor and write it back using "dd". I need help with some linux commands I can use to read the block and change the data to induce the corruption....as I want to automate my... (3 Replies)
Discussion started by: prinsh
3 Replies

9. Shell Programming and Scripting

Automate multiple commands

Hi, I am trying to count the number of times a string of letters occurs in a file for multiple unique strings of letters. Right now I can do this one at a time using the following code (in this example I am searching for the string "AAA"): echo AAA >> outfile.txt grep -c "AAA" -r... (4 Replies)
Discussion started by: gecko1
4 Replies

10. Open Source

Help with writing Shell Script to automate process using multiple commands

Hello! Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies
whom(1mh)																 whom(1mh)

Name
       whom - report to whom a message is addressed

Syntax
       whom [ options ] [ file ]

Description
       The  command is used to expand the headers of a message into a set of addresses, and optionally to verify that those addresses are deliver-
       able at that time if -check is given.

       The command is often invoked as one of the options offered by the program when you have finished editing a draft  message.   See  for  more
       details.

       If  you	want to run on a named file, you can supply a file argument.  This argument allows you to specify a named file; if you want to run
       on an existing message, use the -draftfolder and -draftmessage options.	If you do not give an absolute pathname (one beginning with a / or
       ./ or ../ ), assumes that the named file is in your current working directory.

Options
       -alias aliasfile
		 Specifies  the  alias file to be consulted by If you have used one or more aliases in your message header, will consult the named
		 file to find those aliases, and will print the full addresses as its output.  You can reference more than one file, but each file
		 name must be preceded by the word -alias.  See for more information.

       -check
       -nocheck  Checks  that  the  addresses  are  valid.  makes no guarantees that the addresses listed as being correct are really deliverable:
		 rather, an address being listed as correct means that at the time that was run, the address was thought to be deliverable by  the
		 transport  service.   For local addresses, this means that the local user does exist, and that the address was deliverable at the
		 time of checking.  For network and uucp addresses, it means that the syntax of the address is valid.

       -draft	 Sets the draft message to be the standard file in your Mail directory.

       -draftfolder folder
       -nodraftfolder
		 Specifies the folder in which searches for the draft message.	The default is to use the current message  in  the  named  folder.
		 You  can select another message by using the -draftmessage option.  For more information on using a draft folder, see The -draft-
		 folder option is often set up in your user profile; see for more information.

       -draftmessage msg
		 Specifies the draft message to be used.  If you specify a folder with the -draftfolder option, the -draftmessage option takes the
		 number  of a message in that folder.  If you do not specify a folder, -draftmessage takes the name of a file.	If you do not give
		 an absolute pathname (one beginning with a / or ./ or ../ ), -draftmessage assumes that the file is located in your  Mail  direc-
		 tory.

       -help	 Prints a list of the valid options to this command.

       -mts smtp Specifies the format of the addresses to be checked.  The only value allowed is smtp, which checks that addresses are deliverable
		 over the standard ULTRIX mail system.	Additional values are supported only for use with other mail systems.

       The defaults for this command are:

	      file defaults to
	      -nocheck
	      -alias /usr/lib/mh/MailAliases
	      -mts smtp

Restrictions
       For this version, the -mts option only supports the value smtp.	Additional values are supported for use only with other mail systems.

Examples
       In the following example, would use the current message in the folder:
       % whom -draftfolder +drafts
	 smith: address OK

       In the next example, searches for message 2 in the folder
       % whom -draftfolder +drafts -draftmessage 2
	 davis@hostname: address OK

Profile Components
       Path:	       To determine your MH directory (mh-dir)
       Draft-Folder:   To find the default draft-folder
       postproc:       Program to post the message

Files
       The user profile.

See Also
       comp(1mh), mh-alias(5mh), post(8mh)

																	 whom(1mh)
All times are GMT -4. The time now is 02:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy