问题
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:
- alias secondAlias=firstAlias $t another command
- alias secondAlias=$firstAlias $t another command
- alias secondAlias=`firstAlias` $t another command
- alias secondAlias=%firstAlias% $t another command
- 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