Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Command execution trouble

$
0
0
I am trying to send a command through sshNET:

if [ $(pgrep -f 'SCREEN -S burnintest_screen') ]; then echo Success; fi

On my linux host, this command results in Success when the command is issued directly from the command line (As long as SCREEN is running with the selected command line). If the SCREEN command isn't running, it results in nothing.

When sent via sshNET, it always results in nothing returned.

if [ "$(pgrep -f 'SCREEN -S burnintest_screen')" ]; then echo Success; fi

or

bash -c "if [ \"$(pgrep -f 'SCREEN -S burnintest_screen')\" ]; then echo Success; fi"

These behave the expected way directly from the command line but always results in Success when issued via sshNET.

Encoding is UTF8 (I've tried ASCII as well). The user's shell is bash. I've tried both the RunCommand() and cmd.Execute() approaches.

Any idea what might be happening?

Thanks,

Robert

Viewing all articles
Browse latest Browse all 1729

Latest Images

Trending Articles



Latest Images