Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an alias with multiple commands that accepts parameters in Cmder?

Tags:

alias

cmder

I would like to know how to create one alias with multiple commands in Cmder, that accepts parameters and injects them into the commands.

like image 200
Ramtin Soltani Avatar asked Apr 22 '16 17:04

Ramtin Soltani


1 Answers

To separate commands in a single alias $t would do the trick. To retrieve all the parameters passed to an alias $* would do the trick.

Examples:

  • Multiple Commands: alias serveApp=cd "C:\app" $t grunt serve
  • Parameters: alias nav=cd $*, usage: nav "C:\app"
  • Combination: alias servePath=cd $* $t grunt serve
like image 196
Ramtin Soltani Avatar answered Sep 19 '22 12:09

Ramtin Soltani