question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Forward the exit status from the remote command

See original GitHub issue

Please change the mssh command to forward the exit status of the remote command the same way ssh does.

The man page from ssh describing this:

EXIT STATUS ssh exits with the exit status of the remote command or with 255 if an error occurred.

Example:

kim@splint:~$ mssh ec2-user@i-012345678990 exit 42 ; echo $?
0
kim@splint:~$ 

This should echo 42 instead of 0.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
CptTZcommented, Jun 25, 2020

Hi @yellowtailfan, thanks for providing this! I’m not aware of that fork, however I would recommend verifying that code before using it.

And to everyone else, sorry for the delays in keeping CLI updated. We are now actively working on releasing a new version with some improvements.

1reaction
LeszekBlazewskicommented, Jun 25, 2020

Hey man this is a real life saver, thanks for the link !

On Mon, 22 Jun 2020 at 12:03, Matthew Arnison notifications@github.com wrote:

Getting the return code from mssh is very important for the code I’m working on, so I found a fork with a fix:

mplaza-ptc@57ab4b5 https://github.com/mplaza-ptc/aws-ec2-instance-connect-cli/commit/57ab4b5ab64b0cfd916741b5e7e8479b583c154d

which the author has kindly published at PyPI:

https://pypi.org/project/ec2instanceconnectcli-ptc/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aws/aws-ec2-instance-connect-cli/issues/9#issuecomment-647417783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKPEJQACTC6APJZM7TZ6RLRX4UANANCNFSM4JANBENQ .

– Pozdrawiam,

Leszek Błażewski

https://www.e-korepetycje.net/beard

https://www.linkedin.com/in/leszek-blazewski/

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get exit code of remote command through ssh
1. Formally, to "store" the exit status we should assign it to a variable: ssh remotehost 'do something' ; retcode=$? and it's "stored"...
Read more >
Getting the exit status of a remote command
Hi All, I am using the following code to move files from one folder to another on the remote server: ssh username@server <<EOF...
Read more >
How Expect can capture the exit code from a remote command
How Expect can capture the exit code from a remote command. LGT An example running on unix platform, we execute one command (for...
Read more >
How do I find the exit status of a remote command executed ...
|| : Execute command only if command returns an exit status of non zero. So following command will never display Command failed message:...
Read more >
Get exit code of a executed remote command
first one, but I am not sure. ... send the EOF yet. ... > that seems to work, thanks a lot for your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found