0

I use this command for remote server.

# now=`ssh root@192.168.137.137 -t uptime | awk '{ print $8  }'`
echo "$now"

I get "Connection to 192.168.137.137 closed." but i don't want show this message. I want show only output command. thanks.

2

Since this goes to stderr, you can pipe it to /dev/null:

ssh root@192.168.137.137 -t uptime 2>/dev/null | awk '{ print $8 }'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.