Alias

Qedit 5.7 for HP-UX

Home Previous Next


Alias

Set Alias aliasname To aliasdefinition

Qedit commands have priority over any external commands, such as shell commands and scripts. The fact that Qedit commands can be abbreviated to a few characters (e.g., C for Change) and combined with various suffixes (e.g., CQ for Change Quiet) has caused some problems with seemingly different external commands.

The new Set Alias command now allows you to override Qedit's command priority. Aliases are always executed first. For example, "at" is the abbreviation for Qedit's AddTemplate command (i.e., add new lines with a column template). If you want to use the UNIX "at" command, you can get at it only by explicitly using the exclamation mark prefix (!at).

Using the Alias feature, you can now use

/Set Alias "at" to "!at"

From that point on, entering "at" would always call the shell command.

The alias name and definition must be enclosed in a string delimiter such as quotes. You must use the same delimiter for both items.

/Set Alias "SPJ" to "!ls /home/joe/spj*"            {valid}
/Set Alias \SPJ\ to \!ls /home/joe/spj*\            {valid}
/Set Alias "SPJ" to \!ls /home/joe/spj*\            {invalid}
/Set Alias \SPJ\ to "!ls /home/joe/spj*"            {invalid}

The alias name can have up to 50 characters. It can contain only alphabetic characters. Although the alias should not contain numeric digits, special characters or spaces, the Set command does not currently prevent you from using these characters. If you do use them, the alias feature will not work properly. If you use an alias name that has already been defined, the new definition replaces the old one.

The alias definition can contain up to 77 characters and can include one or more commands. The definition can contain any command that can normally be entered at the Qedit prompt, including other aliases.

You can use Qedit's command stacking feature to enter a series of commands and create something that resembles a macro command.

Set Alias "Five" to "First;F 'string';List */*+5"

The length of all alias names and definitions cannot exceed 2,500 characters.

Stacked commands are separated by a semicolon (;). If you use UNIX commands or shell scripts, you might have to use semicolons to separate parameters. This will confuse Qedit. There are different ways to work around this problem.

You can put the command in another shell script that does not require parameters.

/echo find . -name core -exec rm {} \\\; > myscript
/chmod +x myscript
/Set Alias "SPJ" To "myscript"

The last option is to enclose the command and its parameters in parentheses.

/Set Alias "SPJ" To "L 1;(!find . -name core -exec rm {} \;);V"

If the command itself contains parentheses, you will have to use the shell script approach.

More:

Function Key

Ignorecase

Trace

Remove

Reset


Home Previous Next