Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Thank you, but do you know any safer alternative? Commented Feb 13, 2018 at 12:53
  • I used nc -l $porta_cliente | sh as you said, but when the server receive the text, the following line if [ $? -eq 0 ]; then is automatically setting the $? to 0, so i can´t verify if the user pressed cancel on dialog, any workaround? Commented Feb 13, 2018 at 13:00
  • You would need to replace if [ $? -eq 0 ]; then with if [ \$? -eq 0 ]; then since it's being substituted in there heredoc before it's sent over netcat. Commented Feb 13, 2018 at 13:17
  • As for alternatives, it really depends on what your program wants to be able to do and how much variation the code may have. Have a look at how AJAX is used for a better feel of what kind of information you should be sending over. Keep in mind that with internet, possibly anyone could be seeing the information and at the same time possibly anyone could change the information. In this environment, you should not be sending code over such a channel. Commented Feb 13, 2018 at 13:23
  • Thank you a lot! you don´t even have idea how you helped me :) Commented Feb 13, 2018 at 13:48