0

I'm trying to create ConEmu task in Cmder, I want to navigate to particular directory and run a SSH command and using git-bash for this. I'm able to change directory but can't run the SSH command.

Command

*cmd /c "%ConEmuDir%\..\git-for-windows\bin\bash" --login -i  -new_console:d:E:\Project\SSHKeys && ssh -i "secret.pem" ubuntu@ip_address

Error

'C:\cmder\vendor\conemu-maximus5\..\git-for-windows\bin\bash" --login -i && ssh -i "secret.pem' is not recognized as an internal or external command, operable program or batch file.

Suroor Ahmmad
  • 1,110
  • 4
  • 23
  • 33

1 Answers1

0

You have several problems here

  1. You are SSH-ing to remote server, it doesn't care on your local directory. Why do you want that?

  2. You don't need cmd.exe to run bash command. Don't add spare layers of processed. They have no sense.

  3. Even if you need to run something via cmd /c ... you have to learn how cmd does unquoting. You have to add one more double quote around your command line cmd /c ""something" ... & ..."

Maximus
  • 10,751
  • 8
  • 47
  • 65