next up previous contents index
Next: Command files Up: Basic usage Previous: Special characters

Aliases

    You may configure your own menu structure or simply create, redefine or rename certain commands by using the alias-mechanism. An alias is a named string known to a menu. When parsing the command line TV checks each word whether there is an alias defined and substitutes the according definition in the command line.

Aliases are defined in the menu you are in. You can not define aliases in menus other than the current menu. Since you destroy built-in commands if you redefine them, you must not do that if you want to use them again. For example to define an alias to switch the y-scale to logarithmic enter:

tv > alias lin ``window setup function-y logarithmic ;
window setup function-y normalization on ;
window setup function-y normalization off;''
`` < no arguments > ''

Pay attention to enclose the second and third argument in double quotes ("") if you use definitions consisting of more than one word. The third argument is appended to the usage message printed by lin ?. alias without arguments prints all aliases known to the current menu. unalias lin deletes the alias lin. You may use commandline arguments or environment variables in the second argument following the same convention as in common shells like the bash. To program an alias to switch the y-scale according to a given commandline argument enter

tv > alias yscale ``window setup function-y $(1) ;
window setup function-y normalization on ;
window setup function-y normalization off;''
`` < linear | logarithmic | squared > ''

where $(1) denotes the first argument passed to the yscale command. The parentheses in $(1) must be entered.

alias and unalias are builtin commands of the command line interpreter and therefore available in every menu and not listed by ?.

Aliases defined by default in TV's root menu are help, quit, lin and log and their definitions listed by the alias command are:

tv > alias

aliases in menu:

help="% "xon `hostname` `which lemacs` -f info Tv > /dev/null 2> /dev/nullSPMamp;""

lin="wi sc fu li ; wi sc fu no on ; wi sc fu no off ;"

log="wi sc fu lo ; wi sc fu no on ; wi sc fu no off ;"

quit="exit"


next up previous contents index
Next: Command files Up: Basic usage Previous: Special characters
Andreas Fitzler
7/13/2000