Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Shells: User's Guide: HP 9000 Computers > Chapter 18 Aliasing: Abbreviating Commands

Unsetting an Alias

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

There will be times that you set a common command such as who with a new definition and then decide you need its old functionality back. You can quote, or protect, the alias name to temporarily override the alias, for example, \who. Or you can permanently regain the old functionality by unsetting the alias. To unset an alias use the unalias command. In one of the previous examples who was set to who | sort. To unset who, type:

unalias who

Then, type alias and notice from the listing that who has disappeared from the alias list and now performs it original function. The results of running who before and then after should look something like this:

$ who
mary tty02 Sep 24 14:19
michael tty04 Sep 24 09:41
nick tty01 Sep 24 09:41
$ unalias who
$ who
nick tty01 Sep 24 09:41
mary tty02 Sep 24 14:19
michael tty04 Sep 24 09:41
$

The POSIX and Korn Shells default aliases (i.e., false, integer, ...) can be unset or redefined, as well. The POSIX Shell also provides the -a option with the unalias built-in command. This option can be used to remove all the alias definitions by typing, at the shell command line prompt:

unalias -a
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-1991 Hewlett-Packard Development Company, L.P.