Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
2.if openssh server is Linux hosted, please try with "&&" as a separator;
according to
https://stackoverflow.com/questions/5130847/running-multiple-commands-in-one-line-in-shell