can we exit without error from telnet with MozRepl? -



can we exit without error from telnet with MozRepl? -

based on this answer, trying figure out way exit telnet , homecoming 0

these wont work:

(echo -e "repl.quit()";sleep 1) |telnet localhost 4242;echo $? (echo -e "\029";sleep 1;echo "q";sleep 1) |telnet localhost 4242;echo $? (echo -e "\c]";sleep 1;echo "q";sleep 1) |telnet localhost 4242;echo $? (echo -e "\e]";sleep 1;echo "q";sleep 1) |telnet localhost 4242;echo $? (echo -e "\e]";sleep 1;echo "q";sleep 1) |telnet localhost 4242;echo $?

the problem is: unable differentiate successful exit , failed one...

i think this question can linked.

you need send ^] character, unprintable grouping separator character before telnet client terminates connection after executing commands gave via pipe. versions of echo programme can produce unprintable characters using -e option. grouping separator 035 in octal (you can see entire ascii table man 7 ascii on *nix systems.). so, entire command should this:

$ (echo "content.location.href = 'http://v4.ident.me/'"; sleep 2; echo -e '\035'; sleep 2) | telnet localhost 4242 > /dev/null $ echo $? $ 0

error-handling telnet exit mozrepl

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -