简体   繁体   中英

Pass argument into telnet in Bash

How do you pass arguments in te.net using bash. When I tried to push I keep getting an error.

Input

echo "status" | telnet localhost 5555 > /tmp/text.txt

Output

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

I was expecting the output to redirected to a file for parsing however I am recieving an error.

Te.net can't do what you are trying to do. See full explanation in this posting .

Thank you for the response. I was able to get the output however I had to add quit directive to get out of nc from bash. Here is my statement

echo "status" | nc -w 2 localhost 5555 > /tmp/test.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM