Alias that refers to another alias

☆樱花仙子☆ 提交于 2019-12-11 01:02:38

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/37213516/alias-that-refers-to-another-alias

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!