Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ alias(1) — Digital UNIX 4.0d

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

csh(1)

ksh(1)

Bourne shell sh(1b)

POSIX shell sh(1p)

unalias(1)

Standards:  standards(5)

alias(1)  —  Commands

NAME

alias − Defines or displays aliases

SYNOPSIS

alias [−tx] [alias-name[=string ...]]

Note

The C shell has a built-in version of the alias command.  If you are using the C shell, and want to guarantee that you are using the command described here, you must specify the full path /usr/bin/alias.  See the csh(1) reference page for a description of the built-in command. 

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows:

alias:  XPG4, XPG4−UNIX

Refer to the standards(5) reference page for more information about industry standards and associated tags. 

FLAGS

−t[Digital]  Sets or lists tracked aliases. 

−x[Digital]  Sets or lists exported aliases. 

Note

See the ksh(1) reference page for a description of tracked and exported aliases. 

PARAMETERS

alias-namePrints the alias definition on standard output. 

alias-name=stringAssigns the value of string to the alias alias-name. 

If no flags and no parameters are specified, all alias definitions are printed on standard output. 

DESCRIPTION

The alias utility creates or redefines alias definitions or writes the values of existing alias definitions to standard output.  An alias definition provides a string value that replaces a command name when it is encountered. 

An alias definition affects the current shell execution environment and the execution environments of the subshells of the current shell.  When used as described, the alias definition will not affect the parent process of the current shell nor any utility environment invoked by the shell. 

ENVIRONMENT VARIABLES

The following environment variables affect the execution of alias:

LANGProvides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization variables contain an invalid setting, the utility behaves as if none of the variables had been defined. 

LC_ALLIf set to a non-empty string value, override the values of all the other internationalization variables. 

LC_CTYPEDetermines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). 

LC_MESSAGESDetermines the locale for the format and contents of diagnostic messages written to standard error. 

NLSPATHDetermines the location of message catalogues for the processing of LC_MESSAGES. 

NOTES

[Digital]  This reference page describes the creation and maintenance of aliases.  See the Command Aliasing section of the ksh(1) or sh(1p) reference pages for the description of alias substitution. 

RESTRICTIONS

     1.[Digital]  If you use either the −t flag or the −x flag, you must use at least one alias-name or alias-name=string parameter. 

     2.[Digital]  Aliasing is performed when scripts are read, not while they are executed.  Therefore, for an alias to take effect, the alias definition command has to be executed before the command that references the alias is read. 

     3.[Digital]  Aliases can be used to redefine special built-in commands but cannot be used to redefine the reserved words listed in the ksh(1p) reference page. 

EXAMPLES

     1.Change ls to give annotated output in columns:

alias ls="ls −CF"

     2.Create a simple redo command to repeat previous entries in the command history file:

alias r=’fc −s’

     3.Cause du to use 1K units instead of the default 512-bytes:

alias du=du\ −k

     4.Set up nohup so that it can deal with an argument that is itself an alias name:

alias nohup="nohup "

EXIT VALUES

The following exit values are returned:

0Successful completion

>0One of the name parameters specified did not have an alias definition, or an error occurred

RELATED INFORMATION

Commands: csh(1), ksh(1), Bourne shell sh(1b), POSIX shell sh(1p), unalias(1)

Standards:  standards(5)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026