|
发表于 2010-9-26 22:28:44
|
显示全部楼层
挖ahouvw师姐的坟
Text following the aliasname in the command line is stored in parameters. These parameters %1 through %99 can be used in the string definition of the alias. Special parameters %-1 through %-99 are also defined which represent the parameter plus all text following it. Thus, %-1 contains all text following the alias. %-2 contains everything past the first parameter, and so on.
1。
命令中alias 别名后的为参数,在alias 中可以用%1-99%引用
举例子
#alias pk {kill %1;throw %2 at %1};
那么指令
pk asiaking biao
相当于 kill asiaking;throw biao at asiaking
2.%-1到%-99指后面所有的文本
如
#alias k kill %-1
那么 k asiaking's dummy
就相当 kill asiaking's dummy
%-1包含别名k后所有文本就是 asiaking's dummy
%-2为第一个参数后的所有文本就 dummy
那么
#al do {%-1}
do 后面是什么参数,可以是多个词组,可以用变量,就执行什么指令
#var act kill
#var target dog
do @act @target
相当于 kill dog |
|