This is a new example snippet. The code is largely based on ssh2_exec, and is written by Tommy Lindgren. I edited it into C90 compliance and to conform to libssh2 indent style and some more.