User Tools

Site Tools


telnet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
telnet [2019/12/22 09:50] – created dblumetelnet [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:
 } }
 </code> </code>
 +
 +===== Branching in Expect on whether a remote file exists =====
 +
 +<code expect>
 +send "ls --color=never $FNAME\r"
 +expect {
 +     -re "\n$FNAME" {
 +        expect ":/ #"
 +        send "stat $FNAME\r"
 +        expect ":/ #"
 +        send "echo $FNAME was already there.\r"
 +     }
 +     "No such file or directory" {
 +        expect ":/ #"
 +        send "ls ~\r"
 +        expect ":/ #"
 +        send "echo $FNAME was not there.\r"
 +     }
 +}
 +expect ":/ #"
 +</code>
 +
 +Keywords: telnet, linux, nc, netcat
telnet.1577037019.txt.gz · Last modified: 2023/04/12 20:44 (external edit)