Differences

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

Link to this comparison view

telnet [2019/12/22 09:50]
dblume created
telnet [2019/12/24 10:28] (current)
dblume
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.txt · Last modified: 2019/12/24 10:28 by dblume
 
Recent changes RSS feed Driven by DokuWiki