DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Understanding resources

Saving new specifications in a resource file

If you loaded new resource specifications into the resource database using standard input or the -xrm command line option and now you would like to save the settings permanently in a resource file, you do not need to edit the file manually (although you certainly could.) The -edit option allows you to write the current contents of the resource database to a file. For example:

xrdb -edit ~/.Xdefaults-hostname

This example saves the current contents of the database in the file .Xdefaults-hostname, in your home directory.


NOTE: If the file you specify already exists, its contents are overwritten with the new values. However, xrdb is smart enough to preserve any comments and preprocessor declarations in the file being overwritten, replacing only the old resource specifications.

If you want to save a backup copy of an existing resource file, use the -backup option, in addition to the -edit option:

xrdb -edit ~/.Xdefaults-hostname -backup old

The string following the -backup option is used as an extension that is appended to the old filename. In this example, the old copy of the .Xdefaults-hostname file is saved as .Xdefaults-hostnameold.


Next topic: Removing resource definitions from the resource database
Previous topic: Loading new values into the resource database

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003