Print this page
13507 some man pages need update following 13405
6308 some man pages are obsolete after moving to ksh builtins

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man1/alias.1
          +++ new/usr/src/man/man1/alias.1
↓ open down ↓ 36 lines elided ↑ open up ↑
  37   37  .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38   38  .\" If applicable, add the following below this CDDL HEADER, with the
  39   39  .\" fields enclosed by brackets "[]" replaced with your own identifying
  40   40  .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41   41  .\"
  42   42  .\"
  43   43  .\" Copyright 1989 AT&T
  44   44  .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
  45   45  .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
  46   46  .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
       47 +.\" Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
  47   48  .\"
  48      -.TH ALIAS 1 "Apr 8, 2008"
       49 +.TH ALIAS 1 "Feb 9, 2021"
  49   50  .SH NAME
  50   51  alias, unalias \- create or remove a pseudonym or shorthand for a command or
  51   52  series of commands
  52   53  .SH SYNOPSIS
  53      -.LP
  54   54  .nf
  55   55  \fB/usr/bin/alias\fR [\fIalias-name\fR[= \fIstring\fR...]]
  56   56  .fi
  57   57  
  58   58  .LP
  59   59  .nf
  60   60  \fB/usr/bin/unalias\fR \fIalias-name\fR...
  61   61  .fi
  62   62  
  63   63  .LP
  64   64  .nf
  65   65  \fB/usr/bin/unalias\fR \fB-a\fR
  66   66  .fi
  67   67  
  68   68  .SS "\fBcsh\fR"
  69      -.LP
  70   69  .nf
  71   70  \fBalias\fR [\fIname\fR [\fIdef\fR]]
  72   71  .fi
  73   72  
  74   73  .LP
  75   74  .nf
  76   75  \fBunalias\fR \fIpattern\fR
  77   76  .fi
  78   77  
  79      -.SS "\fBksh\fR"
  80      -.LP
  81      -.nf
  82      -\fBalias\fR [\fB-tx\fR] [\fIname\fR[= \fIvalue\fR]...]
  83      -.fi
  84      -
  85      -.LP
  86      -.nf
  87      -\fBunalias\fR \fIname\fR...
  88      -.fi
  89      -
  90      -.LP
  91      -.nf
  92      -\fBunalias\fR [\fB-a\fR]
  93      -.fi
  94      -
  95   78  .SS "\fBksh93\fR"
  96      -.LP
  97   79  .nf
  98   80  \fBalias\fR [\fB-ptx\fR] [\fIname\fR[= \fIvalue\fR]...]
  99   81  .fi
 100   82  
 101   83  .LP
 102   84  .nf
 103   85  \fBunalias\fR [\fB-a\fR] [\fIname\fR...]
 104   86  .fi
 105   87  
 106   88  .SH DESCRIPTION
 107      -.sp
 108      -.LP
 109   89  The \fBalias\fR and \fBunalias\fR utilities create or remove a pseudonym or
 110   90  shorthand term for a command or series of commands, with different
 111   91  functionality in the C-shell and Korn shell environments.
 112   92  .SS "\fB/usr/bin/alias\fR"
 113      -.sp
 114      -.LP
 115   93  The \fBalias\fR utility creates or redefines alias definitions or writes the
 116   94  values of existing alias definitions to standard output. An alias definition
 117   95  provides a string value that replaces a command name when it is encountered.
 118   96  .sp
 119   97  .LP
 120   98  An alias definition affects the current shell execution environment and the
 121   99  execution environments of the subshells of the current shell. When used as
 122  100  specified by this document, the alias definition does not affect the parent
 123  101  process of the current shell nor any utility environment invoked by the shell.
 124  102  .SS "\fB/usr/bin/unalias\fR"
 125      -.sp
 126      -.LP
 127  103  The \fBunalias\fR utility removes the definition for each alias name specified.
 128  104  The aliases are removed from the current shell execution environment. The
 129  105  \fB-a\fR option removes all alias definitions from the current execution
 130  106  environment.
 131  107  .SS "\fBcsh\fR"
 132      -.sp
 133      -.LP
 134  108  \fBalias\fR assigns \fIdef\fR to the alias \fIname\fR. The assigned \fIdef\fR
 135  109  is a list of words that can contain escaped history-substitution metasyntax.
 136  110  \fIname\fR is not allowed to be \fBalias\fR or \fBunalias\fR. If \fIdef\fR is
 137  111  omitted, the alias \fIname\fR is displayed along with its current definition.
 138  112  If both \fIname\fR and \fIdef\fR are omitted, all aliases are displayed.
 139  113  .sp
 140  114  .LP
 141  115  Because of implementation restrictions, an alias definition must have been
 142  116  entered on a previous command line before it can be used.
 143  117  .sp
 144  118  .LP
 145  119  \fBunalias\fR discards aliases that match (filename substitution)
 146  120  \fIpattern\fR. All aliases can be removed by `\fBunalias *\fR'.
 147      -.SS "\fBksh\fR"
 148      -.sp
 149      -.LP
 150      -\fBalias\fR with no arguments prints the list of aliases in the form
 151      -\fIname=value\fR on standard output. An \fBalias\fR is defined for each name
 152      -whose \fIvalue\fR is specified. A trailing space in \fIvalue\fR causes the next
 153      -word to be checked for alias substitution. The \fB-t\fR flag is used to set and
 154      -list tracked aliases. The value of a tracked alias is the full pathname
 155      -corresponding to the specified \fIname\fR. The value becomes undefined when the
 156      -value of \fBPATH\fR is reset but the aliases remained tracked. Without the
 157      -\fB-t\fR flag, for each \fIname\fR in the argument list for which no
 158      -\fIvalue\fR is specified, the name and value of the alias is printed. The
 159      -\fB-x\fR flag is used to set or print \fIexported alias\fRes. An exported alias
 160      -is defined for scripts invoked by \fIname\fR. The exit status is non-zero if a
 161      -\fIname\fR is specified, but no value, and no alias has been defined for the
 162      -\fIname\fR.
 163      -.sp
 164      -.LP
 165      -The \fBalias\fRs specified by the list of \fIname\fRs can be removed from the
 166      -\fBalias\fR list with \fBunalias\fR.
 167  121  .SS "\fBksh93\fR"
 168      -.sp
 169      -.LP
 170  122  \fBalias\fR creates or redefines alias definitions or writes the existing alias
 171  123  definitions to standard output.
 172  124  .sp
 173  125  .LP
 174  126  An alias definition provides a string value that replaces a command name when
 175  127  the command is read. Alias names can contain any printable character that is
 176  128  not special to the shell. If an alias value ends in a SPACE or TAB, the word
 177  129  following the command name the alias replaces is also checked to see whether it
 178  130  is an alias.
 179  131  .sp
↓ open down ↓ 8 lines elided ↑ open up ↑
 188  140  \fBalias\fR is built-in to the shell as a declaration command so that field
 189  141  splitting and pathname expansion are not performed on the arguments. Tilde
 190  142  expansion occurs on \fIvalue\fR. An alias definition only affects scripts read
 191  143  by the current shell environment. It does not affect scripts run by this shell.
 192  144  .sp
 193  145  .LP
 194  146  \fBunalias\fR removes the definition of each named alias from the current shell
 195  147  execution environment, or all aliases if \fB-a\fR is specified. It does not
 196  148  affect any commands that have already been read and subsequently executed.
 197  149  .SH OPTIONS
 198      -.sp
 199      -.LP
 200  150  The following option is supported by \fBunalias\fR:
 201  151  .sp
 202  152  .ne 2
 203  153  .na
 204  154  \fB\fB-a\fR\fR
 205  155  .ad
 206  156  .RS 6n
 207  157  Removes all alias definitions from the current shell execution environment.
 208  158  .RE
 209  159  
 210      -.SS "\fBksh\fR"
 211      -.sp
 212      -.LP
 213      -The following option is supported by \fBalias\fR:
 214      -.sp
 215      -.ne 2
 216      -.na
 217      -\fB\fB-t\fR\fR
 218      -.ad
 219      -.RS 6n
 220      -Sets and lists tracked aliases.
 221      -.RE
 222      -
 223  160  .SS "\fBksh93\fR"
 224      -.sp
 225      -.LP
 226  161  The following options are supported by \fBalias\fR:
 227  162  .sp
 228  163  .ne 2
 229  164  .na
 230  165  \fB\fB-p\fR\fR
 231  166  .ad
 232  167  .RS 6n
 233  168  Causes the output to be in the form of \fBalias\fR commands that can be used as
 234  169  input to the shell to recreate the current aliases.
 235  170  .RE
↓ open down ↓ 27 lines elided ↑ open up ↑
 263  198  .ne 2
 264  199  .na
 265  200  \fB\fB-a\fR\fR
 266  201  .ad
 267  202  .RS 6n
 268  203  Causes all alias definitions to be removed. \fIname\fR operands are optional
 269  204  and ignored if specified.
 270  205  .RE
 271  206  
 272  207  .SH OPERANDS
 273      -.sp
 274      -.LP
 275  208  The following operands are supported:
 276  209  .SS "\fBalias\fR"
 277      -.sp
 278  210  .ne 2
 279  211  .na
 280  212  \fB\fIalias-name\fR\fR
 281  213  .ad
 282  214  .RS 14n
 283  215  Write the alias definition to standard output.
 284  216  .RE
 285  217  
 286  218  .SS "\fBunalias\fR"
 287      -.sp
 288  219  .ne 2
 289  220  .na
 290  221  \fB\fIalias-name\fR\fR
 291  222  .ad
 292  223  .RS 21n
 293  224  The name of an alias to be removed.
 294  225  .RE
 295  226  
 296  227  .sp
 297  228  .ne 2
↓ open down ↓ 2 lines elided ↑ open up ↑
 300  231  .ad
 301  232  .RS 21n
 302  233  Assign the value of \fIstring\fR to the alias \fIalias-name\fR.
 303  234  .RE
 304  235  
 305  236  .sp
 306  237  .LP
 307  238  If no operands are specified, all alias definitions are written to standard
 308  239  output.
 309  240  .SH OUTPUT
 310      -.sp
 311      -.LP
 312  241  The format for displaying aliases (when no operands or only \fIname\fR operands
 313  242  are specified) is:
 314  243  .sp
 315  244  .in +2
 316  245  .nf
 317  246  "%s=%s\en" \fIname\fR, \fIvalue\fR
 318  247  .fi
 319  248  .in -2
 320  249  .sp
 321  250  
 322  251  .sp
 323  252  .LP
 324  253  The \fIvalue\fR string is written with appropriate quoting so that it is
 325  254  suitable for reinput to the shell.
 326  255  .SH EXAMPLES
 327      -.LP
 328  256  \fBExample 1 \fRModifying a Command's Output
 329  257  .sp
 330  258  .LP
 331  259  This example specifies that the output of the \fBls\fR utility is columnated
 332  260  and more annotated:
 333  261  
 334  262  .sp
 335  263  .in +2
 336  264  .nf
 337  265  example% \fBalias ls="ls \(miCF"\fR
↓ open down ↓ 40 lines elided ↑ open up ↑
 378  306  
 379  307  .sp
 380  308  .in +2
 381  309  .nf
 382  310  example% \fBalias nohup="nohup "\fR
 383  311  .fi
 384  312  .in -2
 385  313  .sp
 386  314  
 387  315  .SH ENVIRONMENT VARIABLES
 388      -.sp
 389      -.LP
 390  316  See \fBenviron\fR(5) for descriptions of the following environment variables
 391  317  that affect the execution of \fBalias\fR and \fBunalias\fR: \fBLANG\fR,
 392  318  \fBLC_ALL\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
 393  319  .SH EXIT STATUS
 394      -.sp
 395      -.LP
 396  320  The following exit values are returned:
 397  321  .sp
 398  322  .ne 2
 399  323  .na
 400  324  \fB\fB0\fR\fR
 401  325  .ad
 402  326  .RS 5n
 403  327  Successful completion.
 404  328  .RE
 405  329  
 406  330  .SS "\fBalias\fR"
 407      -.sp
 408  331  .ne 2
 409  332  .na
 410  333  \fB\fB>0\fR\fR
 411  334  .ad
 412  335  .RS 6n
 413  336  One of the \fIalias-name\fR operands specified did not have an alias
 414  337  definition, or an error occurred.
 415  338  .RE
 416  339  
 417  340  .SS "\fBunalias\fR"
 418      -.sp
 419  341  .ne 2
 420  342  .na
 421  343  \fB\fB>0\fR\fR
 422  344  .ad
 423  345  .RS 6n
 424  346  One of the \fIalias-name\fR operands specified did not represent a valid alias
 425  347  definition, or an error occurred.
 426  348  .RE
 427  349  
 428  350  .SH ATTRIBUTES
 429      -.sp
 430      -.LP
 431  351  See \fBattributes\fR(5) for descriptions of the following attributes:
 432  352  .SS "\fBcsh, ksh\fR"
 433      -.sp
 434      -
 435      -.sp
 436  353  .TS
 437  354  box;
 438  355  c | c
 439  356  l | l .
 440  357  ATTRIBUTE TYPE  ATTRIBUTE VALUE
 441  358  _
 442  359  Interface Stability     Committed
 443  360  _
 444  361  Standard        See \fBstandards\fR(5).
 445  362  .TE
 446  363  
 447  364  .SS "\fBksh93\fR"
 448      -.sp
 449      -
 450      -.sp
 451  365  .TS
 452  366  box;
 453  367  c | c
 454  368  l | l .
 455  369  ATTRIBUTE TYPE  ATTRIBUTE VALUE
 456  370  _
 457  371  Interface Stability     Uncommitted
 458  372  .TE
 459  373  
 460  374  .SH SEE ALSO
 461      -.sp
 462      -.LP
 463  375  \fBcsh\fR(1), \fBksh\fR(1), \fBksh93\fR(1), \fBshell_builtins\fR(1),
 464  376  \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX