United States-English |
|
|
Software Distributor Administration Guide: HP-UX 11i v1, 11i v2, and 11i v3 > Chapter 1 Introduction to Software DistributorWorking from the Command Line |
|
You can invoke all SD-UX commands non-interactively via the command line. This section provides reference information about command-line features available across most of the commands. The command line is most effective for:
A typical command line might look like this: The example shows that you have several ways to specify SD-UX behavior including command-line options (such as -f and -s), input files (mysoft and /mnt/cd), and target selections. A complete list of command line components includes: Each item on this list is discussed in more detail in the following sections. Software selections let you specify software in great detail. You can also use an input file to specify software. The software_selections syntax is identical for all SD-UX commands that require it (bundle[.product[.subproduct][.fileset]][,version] and product[.subproduct][.fileset][,version]):
The version component has the form: [,r <op> revision][,a <op> arch] [,v <op> vendor][,c <op> category][,q=qualifier][,l=location] [,fr <op> revision][,fa <op> arch]
To keep the command line shorter, software selection input files let you specify long lists of software products. With a software selection file, you only have to specify the single file name. The -f command-line option lets you specify a software selection file. For example: swinstall -f mysoft -s /mnt/cd @ targetB In this example, the file mysoft (which resides in the current working directory for software files) contains a list of software selections for the depot /mnt/cd. In the software file, blank lines and comments (lines beginning with #) are ignored. Each software selection must be specified on a separate line. Target selections follow software and source depot selections. If no target selection is named, the target on which the operation will be performed is assumed to be the root (/) directory on your local host. So, you do not have to use the @ sign and [host][:][/directory] designation (described below) if you are operating on the local host or default depot directory. The target_selections syntax is identical for all SD-UX commands that require it:
To keep the command line shorter, target selection input files let you specify long lists of targets. With a target selection file, you only have to specify the single file name. The -t command-line option lets you specify a target file. For example: swinstall -f mysoft -s /mnt/cd -t mytargs In this example, the file mytargs (which resides in the current working directory) contains a list of target selections for the swinstall command. In the target file, blank lines and comments (lines beginning with #) are ignored. Each target selection must be specified on a separate line and must consist of a host name or network address, optionally followed by a colon and a full path: host[:/directory] You can control many SD-UX command policies and behaviors by setting the appropriate command options. You can change the default values of options using predefined files or values you specify directly on the command-line. Altering default values with files can help when you don’t want to specify command behavior every time you invoke the command. These rules govern the way the defaults work:
For system-wide policy setting, use the /var/adm/sw/defaults files. Keep in mind, however, that users may override these options with their own $HOME/.swdefaults file, session files, or command line changes. The template file /usr/lib/sw/sys.defaults provides an easy way to change system-wide or personal option files. The template file lists (as comments):
You can copy values from this file into the system defaults file (/var/adm/sw/defaults), your personal defaults file ($HOME/.swdefaults), or an input file (with the -X input_file option) and edit them to affect SD-UX behavior.
To change the default value of use_alternate_source to true for all users for all future sessions for all commands to which the option applies, place the following line in the /var/adm/sw/defaults file: To change the default value of use_alternate_source to false for your own invocations of the command, place the following line in your $HOME/.swdefaults file: swinstall.use_alternate_source=false To start an interactive swinstall session using the options stored in my_install_defaults to override any system-wide or personal defaults file values: swinstall -i -X my_install_defaults=true To start an interactive install session and reset the use_alternate_source default for this session only: swinstall -i -x use_alternate_source See Appendix A for a complete listing of defaults and their values and descriptions.
Before any SD-UX task starts, the system automatically saves the current command options, source information, software selections, target selections, etc., into a session file. You can then re-use this session information at a later time, even if the command fails. Session information is saved in the $HOME/.sw/sessions/ directory as command.last in which command is the name of the command. Each time you save a session file, it overwrites the previously stored one. (To save multiple session files, you can rename each session file after you invoke the command.) To re-use the automatically saved session file, invoke the command with the -S swcommand.last argument. For example: If you want to save a session file to somewhere other than the default sessions directory, use the -C session_file argument and supply your own absolute path to the file you wish to save. If you do not specify a directory, the default location for the session file is $HOME/.sw/sessions/. To re-execute a session from a command line, specify the session file as the argument for the -S session_file option. Note that when you re-execute a session file, the session file values take precedence over values in the system defaults file or personal defaults file. Likewise, any command line options or parameters that you specify when you invoke the command take precedence over the values in the session file. Here is a sample a session file. It uses the same syntax as the defaults files:
(A typical swinstall session file has approximately 70 lines.) |
Printable version | ||
|