Alias that refers to another alias
Asked Answered
B

1

3

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.

Bracknell answered 13/5, 2016 at 15:7 Comment(4)
Posted same quastion here : #38352422, asked to reply to you as well.Niece
Updated my question, found maybe-something but can't see how to use it.Niece
Solution here : https://mcmap.net/q/1828825/-cmder-how-to-use-an-alias-in-another-aliasNiece
Possible duplicate of Cmder : how to use an alias in another alias?Aforethought
A
2

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
Agrimony answered 6/1, 2017 at 22:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.