Paste 2 commands in qterminal runs 1

When I paste these 2 commands in qterminal only the first command runs and returns the string ‘Ok’

ssh root@ ‘nlbw -c commit’
scp -rp root@ files/

Any idea why?

When you paste two commands like that, I would expect this to happen:
The first command runs right away, the second command is pasted, waiting for you to hit enter before it would run.

Just to get clear what the question is: what did you expect to happen?

I wasn’t clear.
The 2nd command doesn’t get pasted.
The first command prints “Ok”.

I’m not sure. The only thing that comes to mind is that it could be a safety feature connected to ssh, to make sure you don’t accidentally run a command on the remote machine that you wanted to run locally or the other way around.

Is this issue making it harder to do something specific? Or are you just testing some stuff? If you need those specific commands often you could put them into a script and simply call the script whenever you need it.

It’s only that one command.
It’s not a big deal, just a curiosity.

Short answer, yes, some commands as the first command would be like that. I.e., it is because of the first command that you used. Try

paste these 2 commands in qterminal:

echo abc
echo def

I’m sure both will be executed.

For the list of commands as the first command that would be like that, ssh and apt come to my mind, and I’m sure there are more.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.