Hazhir
Hazhir

Reputation: 788

Alias that refers to another alias

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.

Upvotes: 3

Views: 861

Answers (1)

juse7
juse7

Reputation: 41

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

Upvotes: 2

Related Questions