Alias that refers to another alias

2019-07-10 16:56发布

I need to identify an alias command that refers to another alias command in Cmder, for example let's say i define firstAlias like:

alias firstAlias=cd blah/blah

than i create another alias that uses above alias like:

alias secondAlias=firstAlias $t another command

I have already tried these options(including above one) but no luck so far:

  1. alias secondAlias=firstAlias $t another command
  2. alias secondAlias=$firstAlias $t another command
  3. alias secondAlias=`firstAlias` $t another command
  4. alias secondAlias=%firstAlias% $t another command
  5. alias secondAlias=/firstAlias $t another command

any idea appreciated, Thanks in advance.

标签: cmder
1条回答
孤傲高冷的网名
2楼-- · 2019-07-10 17:22

From what it seems you can't use an alias w/ in another alias. So a workaround is to merely call a .bat file or something with all the commands you want in it. Kind of a hassle, but that's what I had to do for my scenario.

I created a .bat file and set my alias to call that file. I put all the commands I cared about in that file...

status=%CMDER_ROOT%\config\status.bat
查看更多
登录 后发表回答