Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tSSH Component is not able to run multiple commands

Hi All,
I'm using tSSH component to connect to windows machine using SSH.
I'm able to connect to the machine and able to run single command. I want to run multiple commands.
I tried with the option Command Separator. If I use multiple commands it's showing the error as "Unable to execute command or shell on remote system: Failed to Execute process."
PFA the screenshot of the tSSH properties.
Any help/suggestion is highly appreciated.

Thanks,
Siva
0683p000009MDzQ.png
Labels (2)
2 Replies
Anonymous
Not applicable
Author

Yo have an OpenSSH server on a Windows machine?
Anonymous
Not applicable
Author

1.if the openssh server is windows hosted, then you can  use "&" as a separator rather than ";"

Run multiple commands (cmd1, cmd2, cmd3) in one line:

cmd1 & cmd2 & cmd3 // run all commands from left to right (& => all)
cmd1 && cmd2 && cmd3 // run all commands from left to right, stop at 1st fail (&& => till fail)
cmd1 | cmd2 | cmd3 // run all commands from left to right, stop at 1st fail, also | is pipe which sends cmd1 output to cmd2 & so on, so use when if you want to pass outputs to other commands - (| => till fail + pass output of left to right)
cmd1 || cmd2 || cmd3 // run all commands from left to right, stop at 1st success (|| => till good)

Summary:

&  => run all  
&& => run L2R till fail  
|  => run L2R till fail + pass output of left to right  
|| => run L2R till good
   where, L2R is left to right

https://stackoverflow.com/questions/50394413/how-to-run-multiple-commands-in-one-line-using-cmd-in-w...

 

2.if openssh server is Linux hosted, please try with  "&&"  as a separator;

 

according to 

  • | pipes (pipelines) the standard output (stdout) of one command into the standard input of another one. Note that stderr still goes into its default destination, whatever that happen to be.
  • |&pipes both stdout and stderr of one command into the standard input of another one. Very useful, available in bash version 4 and above.
  • && executes the right-hand command of && only if the previous one succeeded.
  • || executes the right-hand command of || only it the previous one failed.
  • ; executes the right-hand command of ; always regardless whether the previous command succeeded or failed. Unless set -e was previously invoked, which causes bash to fail on an error.

https://stackoverflow.com/questions/5130847/running-multiple-commands-in-one-line-in-shell