[14] | 1 | |
---|
| 2 | alias - provide an alias for a command |
---|
| 3 | _________________________________________________________________ |
---|
| 4 | |
---|
| 5 | alias [-h] [<name> [<string>]] |
---|
| 6 | |
---|
| 7 | The "alias" command, if given no arguments, will print the definition of all |
---|
| 8 | current aliases. |
---|
| 9 | |
---|
| 10 | Given a single argument, it will print the definition of that alias (if |
---|
| 11 | any). Given two arguments, the keyword "name" becomes an alias for the |
---|
| 12 | command string "string", replacing any other alias with the same name. |
---|
| 13 | |
---|
| 14 | Command options: |
---|
| 15 | |
---|
| 16 | -h |
---|
| 17 | Print the command usage. |
---|
| 18 | |
---|
| 19 | <name> |
---|
| 20 | Alias |
---|
| 21 | |
---|
| 22 | <string> |
---|
| 23 | Command string |
---|
| 24 | |
---|
| 25 | It is possible to create aliases that take arguments by using the history |
---|
| 26 | substitution mechanism. To protect the history substitution character `%' |
---|
| 27 | from immediate expansion, it must be preceded by a `\' when entering the |
---|
| 28 | alias. |
---|
| 29 | |
---|
| 30 | For example: |
---|
| 31 | |
---|
| 32 | vis> alias read read_\%:1 \%:2.\%:1 |
---|
| 33 | vis> read blif lion |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | will create an alias `read', execute "read_blif lion.blif". |
---|
| 37 | |
---|
| 38 | And... |
---|
| 39 | |
---|
| 40 | vis> alias echo2 "echo Hi ; echo \%* !" |
---|
| 41 | vis> echo2 happy birthday |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | will print: |
---|
| 45 | |
---|
| 46 | Hi |
---|
| 47 | happy birthday ! |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | CAVEAT: Currently there is no check to see if there is a circular dependency |
---|
| 51 | in the alias definition. e.g. |
---|
| 52 | |
---|
| 53 | vis> alias foo "print_network_stats; print_network; foo" |
---|
| 54 | |
---|
| 55 | |
---|
| 56 | creates an alias which refers to itself. Executing the command "foo" will |
---|
| 57 | result an infinite loop during which the commands "print_network_stats" and |
---|
| 58 | "print_network" will be executed. |
---|
| 59 | _________________________________________________________________ |
---|
| 60 | |
---|
| 61 | Last updated on 20100410 00h02 |
---|