telnet
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| telnet [2019/12/22 09:50] – created dblume | telnet [2023/04/12 20:44] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 24: | Line 24: | ||
| ===== Transfer a file by issuing a Remote Telnet Command ===== | ===== Transfer a file by issuing a Remote Telnet Command ===== | ||
| + | |||
| + | Netcat (nc) send the file locally, and nc receive the file at the remote device. | ||
| <code bash> | <code bash> | ||
| Line 38: | Line 40: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | ===== Branching in Expect on whether a remote file exists ===== | ||
| + | |||
| + | <code expect> | ||
| + | send "ls --color=never $FNAME\r" | ||
| + | expect { | ||
| + | -re " | ||
| + | expect ":/ #" | ||
| + | send "stat $FNAME\r" | ||
| + | expect ":/ #" | ||
| + | send "echo $FNAME was already there.\r" | ||
| + | } | ||
| + | " | ||
| + | expect ":/ #" | ||
| + | send "ls ~\r" | ||
| + | expect ":/ #" | ||
| + | send "echo $FNAME was not there.\r" | ||
| + | } | ||
| + | } | ||
| + | expect ":/ #" | ||
| + | </ | ||
| + | |||
| + | Keywords: telnet, linux, nc, netcat | ||
telnet.1577037019.txt.gz · Last modified: 2023/04/12 20:44 (external edit)