RPM(8) Red Hat Linux RPM(8)

NAME rpm - RPM Package Manager

SYNOPSIS QUERYING AND VERIFYING PACKAGES: rpm {-q|--query} [select-options] [query-options]

rpm {-V|--verify} [select-options] [verify-options]

rpm --import PUBKEY ...

rpm {-K|--checksig} [--nosignature] [--nodigest] PACKAGE_FILE ...

INSTALLING, UPGRADING, AND REMOVING PACKAGES: rpm {-i|--install} [install-options] PACKAGE_FILE ...

rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...

rpm {-F|--freshen} [install-options] PACKAGE_FILE ...

rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts] [--notriggers] [--repackage] [--test] PACKAGE_NAME ...

MISCELLANEOUS: rpm {--initdb|--rebuilddb}

rpm {--addsign|--resign} PACKAGE_FILE ...

rpm {--querytags|--showrc}

rpm {--setperms|--setugids} PACKAGE_NAME ...

select-options [PACKAGE_NAME] [-a,--all] [-f,--file FILE] [-g,--group GROUP] {-p,--package PACKAGE_FILE] [--fileid MD5] [--hdrid SHA1] [--pkgid MD5] [--tid TID] [--querybynumber HDRNUM] [--triggeredby PACKAGE_NAME] [--whatprovides CAPABILITY] [--whatrequires CAPABILITY]

query-options [--changelog] [-c,--configfiles] [-d,--docfiles] [--dump] [--filesbypkg] [-i,--info] [--last] [-l,--list] [--provides] [--qf,--queryformat QUERYFMT] [-R,--requires] [--scripts] [-s,--state] [--triggers,--triggerscripts]

verify-options [--nodeps] [--nofiles] [--noscripts] [--nodigest] [--nosignature] [--nolinkto] [--nomd5] [--nosize] [--nouser] [--nogroup] [--nomtime] [--nomode] [--nordev]

install-options [--aid] [--allfiles] [--badreloc] [--excludepath OLDPATH] [--excludedocs] [--force] [-h,--hash] [--ignoresize] [--ignorearch] [--ignoreos] [--includedocs] [--justdb] [--nodeps] [--nodigest] [--nosignature] [--nosuggest] [--noorder] [--noscripts] [--notriggers] [--oldpackage] [--percent] [--prefix NEWPATH] [--relocate OLDPATH=NEWPATH] [--repackage] [--replacefiles] [--replacepkgs] [--test]

DESCRIPTION rpm is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages. A pack- age consists of an archive of files and meta-data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. Packages come in two varieties: binary packages, used to encapsulate software to be installed, and source packages, containing the source code and recipe necessary to produce binary packages.

One of the following basic modes must be selected: Query, Verify, Sig- nature Check, Install/Upgrade/Freshen, Uninstall, Initialize Database, Rebuild Database, Resign, Add Signature, Set Owners/Groups, Show Query- tags, and Show Configuration.

GENERAL OPTIONS These options can be used in all the different modes.

-?, --help Print a longer usage message then normal.

--version Print a single line containing the version number of rpm being used.

--quiet Print as little as possible - normally only error messages will be displayed.

-v Print verbose information - normally routine progress messages will be displayed.

-vv Print lots of ugly debugging information.

--rcfile FILELIST Each of the files in the colon separated FILELIST is read sequentially by rpm for configuration information. Only the first file in the list must exist, and tildes will be expanded to the value of $HOME. The default FILELIST is /usr/lib/rpm/rpmrc:/usr/lib/rpm/red- hat/rpmrc:/etc/rpmrc:~/.rpmrc.

--pipe CMD Pipes the output of rpm to the command CMD.

--dbpath DIRECTORY Use the database in DIRECTORY rather than the default path /var/lib/rpm

--root DIRECTORY Use the file system tree rooted at DIRECTORY for all operations. Note that this means the database within DIRECTORY will be used for dependency checks and any scriptlet(s) (e.g. %post if installing, or %prep if building, a package) will be run after a chroot(2) to DIRECTORY.

-D, --defineMACRO EXPR Defines MACRO with value EXPR.

-E, --evalEXPR Prints macro expansion of EXPR.

INSTALL AND UPGRADE OPTIONS The general form of an rpm install command is

rpm {-i|--install} [install-options] PACKAGE_FILE ...

This installs a new package.

The general form of an rpm upgrade command is

rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...

This upgrades or installs the package currently installed to a newer version. This is the same as install, except all other version(s) of the package are removed after the new package is installed.

rpm {-F|--freshen} [install-options] PACKAGE_FILE ...

This will upgrade packages, but only if an earlier version currently exists. The PACKAGE_FILE may be specified as an ftp or http URL, in which case the package will be downloaded before being installed. See FTP/HTTP OPTIONS for information on rpms internal ftp and http client support.

--aid Add suggested packages to the transaction set when needed.

--allfiles Installs or upgrades all the missingok files in the package, regardless if they exist.

--badreloc Used with --relocate, permit relocations on all file paths, not just those OLDPATHs included in the binary package relocation hint(s).

--excludepath OLDPATH Dont install files whose name begins with OLDPATH.

--excludedocs Don t install any files which are marked as documentation (which includes man pages and texinfo documents).

--force Same as using --replacepkgs, --replacefiles, and --oldpackage.

-h, --hash Print 50 hash marks as the package archive is unpacked. Use with -v|--verbose for a nicer display.

--ignoresize Dont check mount file systems for sufficient disk space before installing this package.

--ignorearch Allow installation or upgrading even if the architectures of the binary package and host dont match.

--ignoreos Allow installation or upgrading even if the operating systems of the binary package and host dont match.

--includedocs Install documentation files. This is the default behavior.

--justdb Update only the database, not the filesystem.

--nodigest Dont verify package or header digests when reading.

--nosignature Don t verify package or header signatures when reading.

--nodeps Dont do a dependency check before installing or upgrading a package.

--nosuggest Don t suggest package(s) that provide a missing dependency.

--noorder Dont reorder the packages for an install. The list of packages would normally be reordered to satisfy dependencies.

--noscripts

--nopre

--nopost

--nopreun

--nopostun Dont execute the scriptlet of the same name. The --noscripts option is equivalent to

--nopre --nopost --nopreun --nopostun

and turns off the execution of the corresponding %pre, %post, %preun, and %postun scriptlet(s).

--notriggers

--notriggerin

--notriggerun

--notriggerpostun Dont execute any trigger scriptlet of the named type. The --notriggers option is equivalent to

--notriggerin --notriggerun --notriggerpostun

and turns off execution of the corresponding %triggerin, %trig- gerun, and %triggerpostun scriptlet(s).

--oldpackage Allow an upgrade to replace a newer package with an older one.

--percent Print percentages as files are unpacked from the package archive. This is intended to make rpm easy to run from other tools.

--prefix NEWPATH For relocatable binary packages, translate all file paths that start with the installation prefix in the package relocation hint(s) to NEWPATH.

--relocate OLDPATH=NEWPATH For relocatable binary packages, translate all file paths that start with OLDPATH in the package relocation hint(s) to NEWPATH. This option can be used repeatedly if several OLDPATHs in the package are to be relocated.

--repackage Re-package the files before erasing. The previously installed package will be named according to the macro %_repack- age_name_fmt and will be created in the directory named by the macro %_repackage_dir (default value is /var/spool/repackage).

--replacefiles Install the packages even if they replace files from other, already installed, packages.

--replacepkgs Install the packages even if some of them are already installed on this system.

--test Do not install the package, simply check for and report poten- tial conflicts.

ERASE OPTIONS The general form of an rpm erase command is

rpm {-e|--erase} [--allmatches] [--nodeps] [--noscripts] [--notriggers] [--repackage] [--test] PACKAGE_NAME ...

The following options may also be used:

--allmatches Remove all versions of the package which match PACKAGE_NAME. Normally an error is issued if PACKAGE_NAME matches multiple packages.

--nodeps Dont check dependencies before uninstalling the packages.

--noscripts

--nopreun

--nopostun Don t execute the scriptlet of the same name. The --noscripts option during package erase is equivalent to

--nopreun --nopostun

and turns off the execution of the corresponding %preun, and %postun scriptlet(s).

--notriggers

--notriggerun

--notriggerpostun Don t execute any trigger scriptlet of the named type. The --notriggers option is equivalent to

--notriggerun --notriggerpostun

and turns off execution of the corresponding %triggerun, and %triggerpostun scriptlet(s).

--repackage Re-package the files before erasing. The previously installed package will be named according to the macro %_repack- age_name_fmt and will be created in the directory named by the macro %_repackage_dir (default value is /var/spool/repackage).

--test Dont really uninstall anything, just go through the motions. Useful in conjunction with the -vv option for debugging.

QUERY OPTIONS The general form of an rpm query command is

rpm {-q|--query} [select-options] [query-options]

You may specify the format that package information should be printed in. To do this, you use the

--qf|--queryformat QUERYFMT

option, followed by the QUERYFMT format string. Query formats are mod- ified versions of the standard printf(3) formatting. The format is made up of static strings (which may include standard C character escapes for newlines, tabs, and other special characters) and printf(3) type formatters. As rpm already knows the type to print, the type specifier must be omitted however, and replaced by the name of the header tag to be printed, enclosed by {} characters. Tag names are case insensitive, and the leading RPMTAG_ portion of the tag name may be omitted as well.

Alternate output formats may be requested by following the tag with :typetag. Currently, the following types are supported:

:armor Wrap a public key in ASCII armor.

:base64 Encode binary data using base64.

:date Use strftime(3) "%c" format.

:day Use strftime(3) "%a %b %d %Y" format.

:depflags Format dependency flags.

:fflags Format file flags.

:hex Format in hexadecimal.

:octal Format in octal.

:perms Format file permissions.

:shescape Escape single quotes for use in a script.

:triggertype Display trigger suffix.

For example, to print only the names of the packages queried, you could use %{NAME} as the format string. To print the packages name and dis- tribution information in two columns, you could use %-30{NAME}%{DISTRI- BUTION}. rpm will print a list of all of the tags it knows about when it is invoked with the --querytags argument.

There are two subsets of options for querying: package selection, and information selection.

PACKAGE SELECTION OPTIONS: PACKAGE_NAME Query installed package named PACKAGE_NAME.

-a, --all Query all installed packages.

-f, --file FILE Query package owning FILE.

--fileid MD5 Query package that contains a given file identifier, i.e. the MD5 digest of the file contents.

-g, --group GROUP Query packages with the group of GROUP.

--hdrid SHA1 Query package that contains a given header identifier, i.e. the SHA1 digest of the immutable header region.

-p, --package PACKAGE_FILE Query an (uninstalled) package PACKAGE_FILE. The PACKAGE_FILE may be specified as an ftp or http style URL, in which case the package header will be downloaded and queried. See FTP/HTTP OPTIONS for information on rpms internal ftp and http client support. The PACKAGE_FILE argument(s), if not a binary package, will be interpreted as an ASCII package manifest. Comments are permitted, starting with a #, and each line of a package mani- fest file may include white space separated glob expressions, including URLs with remote glob expressions, that will be expanded to paths that are substituted in place of the package manifest as additional PACKAGE_FILE arguments to the query.

--pkgid MD5 Query package that contains a given package identifier, i.e. the MD5 digest of the combined header and payload contents.

--querybynumber HDRNUM Query the HDRNUMth database entry directly; this is useful only for debugging.

--specfile SPECFILE Parse and query SPECFILE as if it were a package. Although not all the information (e.g. file lists) is available, this type of query permits rpm to be used to extract information from spec files without having to write a specfile parser.

--tid TID Query package(s) that have a given TID transaction identifier. A unix time stamp is currently used as a transaction identifier. All package(s) installed or erased within a single transaction have a common identifier.

--triggeredby PACKAGE_NAME Query packages that are triggered by package(s) PACKAGE_NAME.

--whatprovides CAPABILITY Query all packages that provide the CAPABILITY capability.

--whatrequires CAPABILITY Query all packages that requires CAPABILITY for proper function- ing.

PACKAGE QUERY OPTIONS: --changelog Display change information for the package.

-c, --configfiles List only configuration files (implies -l).

-d, --docfiles List only documentation files (implies -l).

--dump Dump file information as follows (implies -l):

path size mtime md5sum mode owner group isconfig isdoc rdev symlink

--filesbypkg List all the files in each selected package.

-i, --info Display package information, including name, version, and description. This uses the --queryformat if one was specified.

--last Orders the package listing by install time such that the latest packages are at the top.

-l, --list List files in package.

--provides List capabilities this package provides.

-R, --requires List packages on which this package depends.

--scripts List the package specific scriptlet(s) that are used as part of the installation and uninstallation processes.

-s, --state Display the states of files in the package (implies -l). The state of each file is one of normal, not installed, or replaced.

--triggers, --triggerscripts Display the trigger scripts, if any, which are contained in the package.

VERIFY OPTIONS The general form of an rpm verify command is

rpm {-V|--verify} [select-options] [verify-options]

Verifying a package compares information about the installed files in the package with information about the files taken from the package metadata stored in the rpm database. Among other things, verifying compares the size, MD5 sum, permissions, type, owner and group of each file. Any discrepancies are displayed. Files that were not installed from the package, for example, documentation files excluded on instal- lation using the "--excludedocs" option, will be silently ignored.

The package selection options are the same as for package querying (including package manifest files as arguments). Other options unique to verify mode are:

--nodeps Dont verify dependencies of packages.

--nodigest Dont verify package or header digests when reading.

--nofiles Dont verify any attributes of package files.

--noscripts Don t execute the %verifyscript scriptlet (if any).

--nosignature Dont verify package or header signatures when reading.

--nolinkto

--nomd5

--nosize

--nouser

--nogroup

--nomtime

--nomode

--nordev Dont verify the corresponding file attribute.

The format of the output is a string of 8 characters, a possible attribute marker:

c %config configuration file. d %doc documentation file. g %ghost file (i.e. the file contents are not included in the package payload). l %license license file. r %readme readme file.

from the package header, followed by the file name. Each of the 8 characters denotes the result of a comparison of attribute(s) of the file to the value of those attribute(s) recorded in the database. A single "." (period) means the test passed, while a single "?" (question mark) indicates the test could not be performed (e.g. file permissions prevent reading). Otherwise, the (mnemonically emBoldened) character denotes failure of the corresponding --verify test:

S file Size differs M Mode differs (includes permissions and file type) 5 MD5 sum differs D Device major/minor number mismatch L readLink(2) path mismatch U User ownership differs G Group ownership differs T mTime differs

DIGITAL SIGNATURE AND DIGEST VERIFICATION The general forms of rpm digital signature commands are

rpm --import PUBKEY ...

rpm {--checksig} [--nosignature] [--nodigest] PACKAGE_FILE ...

The --checksig option checks all the digests and signatures contained in PACKAGE_FILE to ensure the integrity and origin of the package. Note that signatures are now verified whenever a package is read, and --checksig is useful to verify all of the digests and signatures asso- ciated with a package.

Digital signatures cannot be verified without a public key. An ASCII armored public key can be added to the rpm database using --import. An imported public key is carried in a header, and key ring management is performed exactly like package management. For example, all currently imported public keys can be displayed by:

rpm -qa gpg-pubkey*

Details about a specific public key, when imported, can be displayed by querying. Heres information about the Red Hat GPG/DSA key:

rpm -qi gpg-pubkey-db42a60e

Finally, public keys can be erased after importing just like packages. Heres how to remove the Red Hat GPG/DSA key

rpm -e gpg-pubkey-db42a60e

SIGNING A PACKAGE rpm --addsign|--resign PACKAGE_FILE ...

Both of the --addsign and --resign options generate and insert new sig- natures for each package PACKAGE_FILE given, replacing any existing signatures. There are two options for historical reasons, there is no difference in behavior currently.

USING GPG TO SIGN PACKAGES In order to sign packages using GPG, rpm must be configured to run GPG and be able to find a key ring with the appropriate keys. By default, rpm uses the same conventions as GPG to find key rings, namely the $GNUPGHOME environment variable. If your key rings are not located where GPG expects them to be, you will need to configure the macro %_gpg_path to be the location of the GPG key rings to use.

For compatibility with older versions of GPG, PGP, and rpm, only V3 OpenPGP signature packets should be configured. Either DSA or RSA ver- ification algorithms can be used, but DSA is preferred.

If you want to be able to sign packages you create yourself, you also need to create your own public and secret key pair (see the GPG man- ual). You will also need to configure the rpm macros

%_signature The signature type. Right now only gpg and pgp are supported.

%_gpg_name The name of the "user" whose key you wish to use to sign your packages.

For example, to be able to use GPG to sign packages as the user "John Doe <jdoe@foo.com>" from the key rings located in /etc/rpm/.gpg using the executable /usr/bin/gpg you would include

%_signature gpg %_gpg_path /etc/rpm/.gpg %_gpg_name John Doe <jdoe@foo.com> %_gpgbin /usr/bin/gpg

in a macro configuration file. Use /etc/rpm/macros for per-system con- figuration and ~/.rpmmacros for per-user configuration.

REBUILD DATABASE OPTIONS The general form of an rpm rebuild database command is

rpm {--initdb|--rebuilddb} [-v] [--dbpath DIRECTORY] [--root DIRECTORY]

Use --initdb to create a new database if one doesnt already exist (existing database is not overwritten), use --rebuilddb to rebuild the database indices from the installed package headers.

SHOWRC The command

rpm --showrc

shows the values rpm will use for all of the options are currently set in rpmrc and macros configuration file(s).

FTP/HTTP OPTIONS rpm can act as an FTP and/or HTTP client so that packages can be queried or installed from the internet. Package files for install, upgrade, and query operations may be specified as an ftp or http style URL:

ftp://USER:PASSWORD@HOST:PORT/path/to/package.rpm

If the :PASSWORD portion is omitted, the password will be prompted for (once per user/hostname pair). If both the user and password are omit- ted, anonymous ftp is used. In all cases, passive (PASV) ftp transfers are performed.

rpm allows the following options to be used with ftp URLs:

--ftpproxy HOST The host HOST will be used as a proxy server for all ftp trans- fers, which allows users to ftp through firewall machines which use proxy systems. This option may also be specified by config- uring the macro %_ftpproxy.

--ftpport PORT The TCP PORT number to use for the ftp connection on the proxy ftp server instead of the default port. This option may also be specified by configuring the macro %_ftpport.

rpm allows the following options to be used with http URLs:

--httpproxy HOST The host HOST will be used as a proxy server for all http trans- fers. This option may also be specified by configuring the macro %_httpproxy.

--httpport PORT The TCP PORT number to use for the http connection on the proxy http server instead of the default port. This option may also be specified by configuring the macro %_httpport.

LEGACY ISSUES Executing rpmbuild The build modes of rpm are now resident in the /usr/bin/rpmbuild exe- cutable. Although legacy compatibility provided by the popt aliases below has been adequate, the compatibility is not perfect; hence build mode compatibility through popt aliases is being removed from rpm. Install the package containing rpmbuild (usually rpm-build) and see rpmbuild(8) for documentation of all the rpm build modes previously documented here in rpm(8).

Add the following lines to /etc/popt if you wish to continue invoking rpmbuild from the rpm command line:

rpm exec --bp rpmb -bp rpm exec --bc rpmb -bc rpm exec --bi rpmb -bi rpm exec --bl rpmb -bl rpm exec --ba rpmb -ba rpm exec --bb rpmb -bb rpm exec --bs rpmb -bs rpm exec --tp rpmb -tp rpm exec --tc rpmb -tc rpm exec --ti rpmb -ti rpm exec --tl rpmb -tl rpm exec --ta rpmb -ta rpm exec --tb rpmb -tb rpm exec --ts rpmb -ts rpm exec --rebuild rpmb --rebuild rpm exec --recompile rpmb --recompile rpm exec --clean rpmb --clean rpm exec --rmsource rpmb --rmsource rpm exec --rmspec rpmb --rmspec rpm exec --target rpmb --target rpm exec --short-circuit rpmb --short-circuit

FILES rpmrc Configuration /usr/lib/rpm/rpmrc /usr/lib/rpm/redhat/rpmrc /etc/rpmrc ~/.rpmrc

Macro Configuration /usr/lib/rpm/macros /usr/lib/rpm/redhat/macros /etc/rpm/macros ~/.rpmmacros

Database /var/lib/rpm/Basenames /var/lib/rpm/Conflictname /var/lib/rpm/Dirnames /var/lib/rpm/Filemd5s /var/lib/rpm/Group /var/lib/rpm/Installtid /var/lib/rpm/Name /var/lib/rpm/Packages /var/lib/rpm/Providename /var/lib/rpm/Provideversion /var/lib/rpm/Pubkeys /var/lib/rpm/Removed /var/lib/rpm/Requirename /var/lib/rpm/Requireversion /var/lib/rpm/Sha1header /var/lib/rpm/Sigmd5 /var/lib/rpm/Triggername

Temporary /var/tmp/rpm*

SEE ALSO popt(3), rpm2cpio(8), rpmbuild(8),

rpm --help - as rpm supports customizing the options via popt aliases its impossible to guarantee that whats described in the manual matches whats available.

http://www.rpm.org/ <URL:http://www.rpm.org/>

AUTHORS Marc Ewing <marc@redhat.com> Jeff Johnson <jbj@redhat.com> Erik Troan <ewt@redhat.com>

Red Hat, Inc. 09 June 2002 RPM(8) DIALOG(1) DIALOG(1)

NAME dialog - display dialog boxes from shell scripts

SYNOPSIS dialog --clear dialog --create-rc file dialog --print-maxsize dialog common-options box-options

DESCRIPTION Dialog is a program that will let you to present a variety of questions or display messages using dialog boxes from a shell script. These types of dialog boxes are implemented (though not all are necessarily compiled into dialog):

calendar, checklist, form, fselect, gauge, infobox, inputbox, inputmenu, menu, msgbox (message), password, pause, radiolist, tailbox, tailboxbg, textbox, timebox, and yesno (yes/no).

You can put more than one dialog box into a script:

- Use the "--and-widget" token to force Dialog to proceed to the next dialog unless you have pressed ESC to cancel, or

- Simply add the tokens for the next dialog box, making a chain. Dialog stops chaining when the return code from a dialog is nonzero, e.g., Cancel or No (see DIAGNOSTICS).

Some widgets, e.g., checklist, will write text to dialogs output. Normally that is the standard error, but there are options for changing this: "--output-fd", "--stderr" and "--stdout". No text is written if the Cancel button (or ESC) is pressed; dialog exits immediately in that case.

OPTIONS All options begin with "--" (two ASCII hyphens, for the benefit of those using systems with deranged locale support).

A "--" by itself is used as an escape, i.e., the next token on the com- mand-line is not treated as an option. dialog --title -- --Not an option

The "--args" option tells dialog to list the command-line parameters to the standard error. This is useful when debugging complex scripts using the "--" and "--file", since the command-line may be rewritten as these are expanded.

The "--file" option tells dialog to read parameters from the file named as its value. dialog --file parameterfile Blanks not within double-quotes are discarded (use backslashes to quote single characters). The result is inserted into the command-line, replacing "--file" and its option value. Interpretation of the com- mand-line resumes from that point.

Common Options --aspect ratio This gives you some control over the box dimensions when using auto sizing (specifying 0 for height and width). It represents width / height. The default is 9, which means 9 characters wide to every 1 line high.

--backtitle backtitle Specifies a backtitle string to be displayed on the backdrop, at the top of the screen.

--begin y x Specify the position of the upper left corner of a dialog box on the screen.

--cancel-label string Override the label used for "Cancel" buttons.

--clear Clears the widget screen, keeping only the screen_color back- ground. Use this when you combine widgets with "--and-widget" to erase the contents of a previous widget on the screen, so it won t be seen under the contents of a following widget. Under- stand this as the complement of "--keep-window". To compare the effects, use these:

All three widgets visible, staircase effect, ordered 1,2,3: dialog --begin 2 2 --yesno "" 0 0 --and-widget --begin 4 4 --yesno "" 0 0 --and-widget --begin 6 6 --yesno "" 0 0

Only the last widget is left visible: dialog --clear --begin 2 2 --yesno "" 0 0 --and-widget --clear --begin 4 4 --yesno "" 0 0 --and-widget --begin 6 6 --yesno "" 0 0

All three widgets visible, staircase effect, ordered 3,2,1: dialog --keep-window --begin 2 2 --yesno "" 0 0 --and-widget --keep-window --begin 4 4 --yesno "" 0 0 --and-widget --begin 6 6 --yesno "" 0 0

First and third widget visible, staircase effect, ordered 3,1: dialog --keep-window --begin 2 2 --yesno "" 0 0 --and-widget --clear --begin 4 4 --yesno "" 0 0 --and-widget --begin 6 6 --yesno "" 0 0

Note, if you want to restore original console colors and send your cursor home after the dialog program has exited, use the clear (1) command.

--colors Interpret embedded " sequences in the dialog text by the following character, which tells dialog to set colors or video attributes: 0 through 7 are the ANSI used in curses: black, red, green, yellow, blue, magenta, cyan and white respectively. Bold is set by b, reset by B. Reverse is set by r, reset by R. Underline is set by u, reset by U . The settings are cumulative, e.g., "" makes thered.followingRestoretextnormalbold (perhapright) settings with "". --cr-wrap Interpret embedded newlines in the dialog text as a newline on the screen. Otherwise, dialog will only wrap lines where needed to fit inside the text box. Even though you can control line breaks with this, dialog will still wrap any lines that are too long for the width of the box. Without cr-wrap, the layout of your text may be formatted to look nice in the source code of your script without affecting the way it will look in the dia- log.

See also the "--no-collapse" and "--trim" options.

--create-rc file When dialog supports run-time configuration, this can be used to dump a sample configuration file to the file specified by file.

--defaultno Make the default value of the yes/no box a No. Likewise, make the default button of widgets that provide "OK" and "Cancel" a Cancel. If "--nocancel" or "--visit-items" are given those options overrides this, making the default button always "Yes" (internally the same as "OK").

--default-item string Set the default item in a checklist, form or menu box. Normally the first item in the box is the default.

--exit-label string Override the label used for "EXIT" buttons.

--extra-button Show an extra button, between "OK" and "Cancel" buttons.

--extra-label string Override the label used for "Extra" buttons. Note: for input- menu widgets, this defaults to "Rename".

--help Prints the help message to dialogs output. The help message is printed if no options are given.

--help-button Show a help-button after "OK" and "Cancel" buttons, i.e., in checklist, radiolist and menu boxes. If "--item-help" is also given, on exit the return status will be the same as for the "OK" button, and the item-help text will be written to dialogs output after the token "HELP". Otherwise, the return status will indicate that the Help button was pressed, and no message printed.

--help-label string Override the label used for "Help" buttons.

--help-status If the help-button is selected, writes the checklist, radiolist or form information after the item-help "HELP" information. This can be used to reconstruct the state of a checklist after processing the help request.

--ignore Ignore options that dialog does not recognize. Some well-known ones such as "--icon" are ignored anyway, but this is a better choice for compatibility with other implementations.

--input-fd fd Read keyboard input from the given file descriptor. Most dialog scripts read from the standard input, but the gauge widget reads a pipe (which is always standard input). Some configurations do not work properly when dialog tries to reopen the terminal. Use this option (with appropriate juggling of file-descriptors) if your script must work in that type of environment.

--insecure Makes the password widget friendlier but less secure, by echoing asterisks for each character.

--item-help Interpret the tags data for checklist, radiolist and menu boxes adding a column which is displayed in the bottom line of the screen, for the currently selected item.

--keep-window Normally when dialog performs several tailboxbg widgets con- nected by "--and-widget", it clears the old widget from the screen by painting over it. Use this option to suppress that repainting.

At exit, dialog repaints all of the widgets which have been marked with "--keep-window", even if they are not tailboxbg wid- gets. That causes them to be repainted in reverse order. See the discussion of the "--clear" option for examples.

--max-input size Limit input strings to the given size. If not specified, the limit is 2048.

--no-cancel

--nocancel Suppress the "Cancel" button in checklist, inputbox and menu box modes. A script can still test if the user pressed the ESC key to cancel to quit.

--no-collapse Normally dialog converts tabs to spaces and reduces multiple spaces to a single space for text which is displayed in a mes- sage boxes, etc. Use this option to disable that feature. Note that dialog will still wrap text, subject to the "--cr-wrap" and "--trim" options.

--no-kill Tells dialog to put the tailboxbg box in the background, print- ing its process id to dialogs output. SIGHUP is disabled for the background process.

--no-label string Override the label used for "No" buttons.

--no-shadow Suppress shadows that would be drawn to the right and bottom of each dialog box.

--ok-label string Override the label used for "OK" buttons.

--output-fd fd Direct output to the given file descriptor. Most dialog scripts write to the standard error, but error messages may also be written there, depending on your script.

--print-maxsize Print the maximum size of dialog boxes, i.e., the screen size, to dialog s output. This may be used alone, without other options.

--print-size Prints the size of each dialog box to dialog s output.

--print-version Prints dialog s version to dialogs output. This may be used alone, without other options.

--separate-output For checklist widgets, output result one line at a time, with no quoting. This facilitates parsing by another program.

--separator string

--separate-widget string Specify a string that will separate the output on dialogs out- put from each widget. This is used to simplify parsing the result of a dialog with several widgets. If this option is not given, the default separator string is a tab character.

--shadow Draw a shadow to the right and bottom of each dialog box.

--single-quoted Use single-quoting as needed (and no quotes if unneeded) for the output of checklist s as well as the item-help text. If this option is not set, dialog uses double quotes around each item. That requires occasional use of backslashes to make the output useful in shell scripts.

--size-err Check the resulting size of a dialog box before trying to use it, printing the resulting size if it is larger than the screen. (This option is obsolete, since all new-window calls are checked).

--sleep secs Sleep (delay) for the given number of seconds after processing a dialog box.

--stderr Direct output to the standard error. This is the default, since curses normally writes screen updates to the standard output.

--stdout Direct output to the standard output. This option is provided for compatibility with Xdialog, however using it in portable scripts is not recommended, since curses normally writes its screen updates to the standard output. If you use this option, dialog attempts to reopen the terminal so it can write to the display. Depending on the platform and your environment, that may fail.

--tab-correct Convert each tab character to one or more spaces. Otherwise, tabs are rendered according to the curses librarys interpreta- tion.

--tab-len n Specify the number of spaces that a tab character occupies if the "--tab-correct" option is given. The default is 8.

--timeout secs Timeout (exit with error code) if no user response within the given number of seconds. This is overridden if the background "--tailboxbg is used. A timeout of zero seconds is ignored.

--title title Specifies a title string to be displayed at the top of the dia- log box.

--trim eliminate leading blanks, trim literal newlines and repeated blanks from message text.

See also the "--cr-wrap" and "--no-collapse" options.

--version Same as "--print-version".

--visit-items Modify the tab-traversal of checklist, radiobox, menubox and inputmenu to include the list of items as one of the states. This is useful as a visual aid, i.e., the cursor position helps some users.

When this option is given, the cursor is initially placed on the list. Abbreviations (the first letter of the tag) apply to the list items. If you tab to the button row, abbreviations apply to the buttons.

--yes-label string Override the label used for "Yes" buttons.

Box Options All dialog boxes have at least three parameters:

text the caption or contents of the box.

height the height of the dialog box.

width the width of the dialog box.

Other parameters depend on the box type.

--calendar text height width day month year A calendar box displays month, day and year in separately adjustable windows. If the values for day, month or year are missing or negative, the current date s corresponding values are used. You can increment or decrement any of those using the left-, up-, right- and down-arrows. Use vi-style h, j, k and l for moving around the array of days in a month. Use tab or backtab to move between windows. If the year is given as zero, the current date is used as an initial value.

On exit, the date is printed in the form day/month/year.

--checklist text height width list-height [ tag item status ] ... A checklist box is similar to a menu box; there are multiple entries presented in the form of a menu. Instead of choosing one entry among the entries, each entry can be turned on or off by the user. The initial on/off state of each entry is speci- fied by status.

On exit, a list of the tag strings of those entries that are turned on will be printed on dialogs output. If the "--sepa- rate-output" option is not given, the strings will be quoted to make it simple for scripts to separate them. See the "--single- quoted" option, which modifies the quoting behavior.

--form text height width formheight [ label y x item y x flen ilen ] ... The form dialog displays a form consisting of labels and fields, which are positioned on a scrollable window by coordinates given in the script. The field length flen and input-length ilen tell how long the field can be. The former defines the length shown for a selected field, while the latter defines the permissible length of the data entered in the field.

- If flen is zero, the corresponding field cannot be altered. and the contents of the field determine the displayed-length.

- If flen is negative, the corresponding field cannot be altered, and the negated value of flen is used as the dis- played-length.

- If ilen is zero, it is set to flen.

Use up/down arrows (or control/N, control/P) to move between fields. Use tab to move between windows.

On exit, the contents of the form-fields are written to dialogs output, each field separated by a newline. The text used to fill non-editable fields (flen is zero or negative) is not writ- ten out.

--fselect filepath height width The file-selection dialog displays a text-entry window in which you can type a filename (or directory), and above that two win- dows with directory names and filenames.

Here filepath can be a filepath in which case the file and directory windows will display the contents of the path and the text-entry window will contain the preselected filename.

Use tab or arrow keys to move between the windows. Within the directory or filename windows, use the up/down arrow keys to scroll the current selection. Use the space-bar to copy the current selection into the text-entry window.

Typing any printable characters switches focus to the text-entry window, entering that character as well as scrolling the direc- tory and filename windows to the closest match.

Use a carriage return or the "OK" button to accept the current value in the text-entry window and exit.

On exit, the contents of the text-entry window are written to dialogs output.

--gauge text height width [percent] A gauge box displays a meter along the bottom of the box. The meter indicates the percentage. New percentages are read from standard input, one integer per line. The meter is updated to reflect each new percentage. If the standard input reads the string "XXX", then subsequent lines up to another "XXX" are used for a new prompt. The gauge exits when EOF is reached on the standard input.

The percent value denotes the initial percentage shown in the meter. If not specified, it is zero.

On exit, no text is written to dialogs output. The widget accepts no input, so the exit status is always OK.

--infobox text height width An info box is basically a message box. However, in this case, dialog will exit immediately after displaying the message to the user. The screen is not cleared when dialog exits, so that the message will remain on the screen until the calling shell script clears it later. This is useful when you want to inform the user that some operations are carrying on that may require some time to finish.

On exit, no text is written to dialog s output. Only an "OK" button is provided for input, but an ESC exit status may be returned.

--inputbox text height width [init] An input box is useful when you want to ask questions that require the user to input a string as the answer. If init is supplied it is used to initialize the input string. When enter- ing the string, the backspace, delete and cursor keys can be used to correct typing errors. If the input string is longer than can fit in the dialog box, the input field will be scrolled.

On exit, the input string will be printed on dialog s output.

--inputmenu text height width menu-height [ tag item ] ... An inputmenu box is very similar to an ordinary menu box. There are only a few differences between them:

1. The entries are not automatically centered but left adjusted.

2. An extra button (called Rename) is implied to rename the current item when it is pressed.

3. It is possible to rename the current entry by pressing the Rename button. Then dialog will write the following on dia- logs output.

RENAMED <tag> <item>

--menu text height width menu-height [ tag item ] ... As its name suggests, a menu box is a dialog box that can be used to present a list of choices in the form of a menu for the user to choose. Choices are displayed in the order given. Each menu entry consists of a tag string and an item string. The tag gives the entry a name to distinguish it from the other entries in the menu. The item is a short description of the option that the entry represents. The user can move between the menu entries by pressing the cursor keys, the first letter of the tag as a hot-key, or the number keys 1-9. There are menu-height entries displayed in the menu at one time, but the menu will be scrolled if there are more entries than that.

On exit the tag of the chosen menu entry will be printed on dia- logs output. If the "--help-button" option is given, the cor- responding help text will be printed if the user selects the help button.

--msgbox text height width A message box is very similar to a yes/no box. The only differ- ence between a message box and a yes/no box is that a message box has only a single OK button. You can use this dialog box to display any message you like. After reading the message, the user can press the ENTER key so that dialog will exit and the calling shell script can continue its operation.

On exit, no text is written to dialogs output. Only an "OK" button is provided for input, but an ESC exit status may be returned.

--pause text height width seconds A pause box displays a meter along the bottom of the box. The meter indicates how many seconds remain until the end of the pause. The pause exits when timeout is reached (status OK) or the user presses the Exit button (status CANCEL).

--passwordbox text height width [init] A password box is similar to an input box, except that the text the user enters is not displayed. This is useful when prompting for passwords or other sensitive information. Be aware that if anything is passed in "init", it will be visible in the systems process table to casual snoopers. Also, it is very confusing to the user to provide them with a default password they cannot see. For these reasons, using "init" is highly discouraged. See "--insecure" if you do not care about your password.

On exit, the input string will be printed on dialog s output.

--radiolist text height width list-height [ tag item status ] ... A radiolist box is similar to a menu box. The only difference is that you can indicate which entry is currently selected, by setting its status to on.

On exit, the name of the selected item is written to dialogs output.

--tailbox file height width Display text from a file in a dialog box, as in a "tail -f" com- mand. Scroll left/right using vi-style h and l , or arrow- keys. A 0 resets the scrolling.

On exit, no text is written to dialogs output. Only an "OK" button is provided for input, but an ESC exit status may be returned.

--tailboxbg file height width Display text from a file in a dialog box as a background task, as in a "tail -f &" command. Scroll left/right using vi-style h and l, or arrow-keys. A 0 resets the scrolling.

Dialog treats the background task specially if there are other widgets (--and-widget) on the screen concurrently. Until those widgets are closed (e.g., an "OK"), dialog will perform all of the tailboxbg widgets in the same process, polling for updates. You may use a tab to traverse between the widgets on the screen, and close them individually, e.g., by pressing ENTER. Once the non-tailboxbg widgets are closed, dialog forks a copy of itself into the background, and prints its process id if the "--no- kill" option is given.

On exit, no text is written to dialog s output. Only an "EXIT" button is provided for input, but an ESC exit status may be returned.

NOTE: Older versions of dialog forked immediately and attempted to update the screen individually. Besides being bad for per- formance, it was unworkable. Some older scripts may not work properly with the polled scheme.

--textbox file height width A text box lets you display the contents of a text file in a dialog box. It is like a simple text file viewer. The user can move through the file by using the cursor, page-up, page-down and HOME/END keys available on most keyboards. If the lines are too long to be displayed in the box, the LEFT/RIGHT keys can be used to scroll the text region horizontally. You may also use vi-style keys h, j, k, l in place of the cursor keys, and B or N in place of the page-up and page-down keys. Scroll up/down using vi-style k and j, or arrow-keys. Scroll left/right using vi-style h and l , or arrow-keys. A 0 resets the left/right scrolling. For more convenience, vi-style forward and backward searching functions are also provided.

On exit, no text is written to dialogs output. Only an "EXIT" button is provided for input, but an ESC exit status may be returned.

--timebox text height [width hour minute second] A dialog is displayed which allows you to select hour, minute and second. If the values for hour, minute or second are miss- ing or negative, the current dates corresponding values are used. You can increment or decrement any of those using the left-, up-, right- and down-arrows. Use tab or backtab to move between windows.

On exit, the result is printed in the form hour:minute:second.

--yesno text height width A yes/no dialog box of size height rows by width columns will be displayed. The string specified by text is displayed inside the dialog box. If this string is too long to fit in one line, it will be automatically divided into multiple lines at appropriate places. The text string can also contain the sub-string "n" or newline characters n_to control line breaking explicitly. This dialog box is useful for asking questions that require the user to answer either yes or no. The dialog box has a Yes but- ton and a No button, in which the user can switch between by pressing the TAB key.

On exit, no text is written to dialogs output. In addition to the "Yes" and "No" exit codes (see DIAGNOSTICS) an ESC exit sta- tus may be returned.

The codes used for "Yes" and "No" match those used for "OK" and "Cancel", internally no distinction is made.

Obsolete Options --beep This was used to tell the original cdialog that it should make a beep when the separate processes of the tailboxbg widget would repaint the screen.

--beep-after Beep after a user has completed a widget by pressing one of the buttons.

RUN-TIME CONFIGURATION 1. Create a sample configuration file by typing:

"dialog --create-rc <file>"

2. At start, dialog determines the settings to use as follows:

a) if environment variable DIALOGRC is set, its value determines the name of the configuration file.

b) if the file in (a) is not found, use the file $HOME/.dialogrc as the configuration file.

c) if the file in (b) is not found, try using the GLOBALRC file determined at compile-time, i.e., /etc/dialogrc.

d) if the file in (c) is not found, use compiled in defaults.

3. Edit the sample configuration file and copy it to some place that dialog can find, as stated in step 2 above.

ENVIRONMENT DIALOGOPTS Define this variable to apply any of the common options to each widget. Most of the common options are reset before processing each widget. If you set the options in this environment variable, they are applied to dia- logs state after the reset. As in the "--file" option, double-quotes and backslashes are interpreted.

The "--file" option is not considered a common option (so you cannot embed it within this environment vari- able).

DIALOGRC Define this variable if you want to specify the name of the configuration file to use.

DIALOG_CANCEL

DIALOG_ERROR

DIALOG_ESC

DIALOG_EXTRA

DIALOG_HELP

DIALOG_ITEM_HELP

DIALOG_OK Define any of these variables to change the exit code on Cancel (1), error (-1), ESC (255), Extra (3), Help (2), Help with --item-help (2), or OK (0). Normally shell scripts cannot distinguish between -1 and 255.

DIALOG_TTY Set this variable to "1" to provide compatibility with older versions of dialog which assumed that if the script redirects the standard output, that the "--std- out" option was given.

FILES $HOME/.dialogrc default configuration file

EXAMPLES The dialog sources contain several samples of how to use the different box options and how they look. Just take a look into the directory samples/ of the source.

DIAGNOSTICS Exit status is subject to being overridden by environment variables. Normally they are:

0 if dialog is exited by pressing the Yes or OK button.

1 if the No or Cancel button is pressed.

2 if the Help button is pressed.

3 if the Extra button is pressed.

-1 if errors occur inside dialog or dialog is exited by pressing the ESC key.

BUGS Perhaps.

AUTHOR Thomas E. Dickey (updates for 0.9b and beyond)

CONTRIBUTORS Tobias C. Rittweiler

Valery Reznic - the form widget.

Yura Kalinichenko adapted the guage widget as "pause".

This is a rewrite (except as needed to provide compatibility) of the earlier version of dialog 0.9a, which lists as authors:

Savio Lam - version 0.3, "dialog"

Stuart Herbert - patch for version 0.4

Marc Ewing - the gauge widget.

Pasquale De Marco "Pako" - version 0.9a, "cdialog"

$Date: 2005/10/30 20:12:00 $ DIALOG(1)