How to create an alias for 2 commands in ConEmu?

1

I have two alias in user-aliases.cmd:

title=cmd /c RenameTab "$*" 
ap5pro=ssh  170.63.170.72

When calling the first:

$ title "sometitle"

It works; the tab title changes to "sometitle"

AND when I call the second:

$ ap5pro

I got the ssh asking me for password, so everything is working.

How can I combine the above two comnands into one in user-aliases.cmd?

Update :

I did these :

ap5pro=RenameTab ap5pro $t ssh  170.63.170.72

and

ap5pro=RenameTab ap5pro & ssh  170.63.170.72

but only ssh is executed, never RenameTab.

Majid

Posted 2017-04-06T15:50:15.217

Reputation: 21

What is the problem? Use & – Maximus – 2017-04-06T16:03:56.710

loook at my update, it does not work with & or with $t. – Majid – 2017-04-06T18:45:34.790

when I did yours alias ap5pro2=cmd /c "ap5pro=RenameTab ap5pro & ssh 170.63.170.72" I got & was unexpected at this time – Majid – 2017-04-10T17:49:19.877

Sort of. Play with quotes if it's not working. alias ap5pro="cmd /c "RenameTab ap5pro & ssh 170.63.170.72"" – Maximus – 2017-04-10T23:31:06.603

Answers

1

alias ap5pro2=cmd /c RenameTab ap5pro $t ssh 170.63.170.72

Majid

Posted 2017-04-06T15:50:15.217

Reputation: 21

Can you explain or expand on this? – bertieb – 2017-04-10T20:04:29.940

Two years too late - but $T (or $t) is a command terminator in an alias which is the equivalent of hitting enter. So the above solution just executes the two commands one after the other. – Chris Cooper – 2019-08-21T09:40:47.347