LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Sockets in bash (https://www.linuxquestions.org/questions/ubuntu-63/sockets-in-bash-584286/)

valkarin 09-12-2007 07:19 PM

Sockets in bash
 
I read a cool tutorial on socket access in bash, however it requires /dev/tcp or /dev/ucp which do not exist on Debian or Debian based systems (such as Ubuntu). The functionality has to be compiled into bash and the node? has to be present in the system. Is there another method of doing this? I want to write a script that fetches a web page and then pipes it to an html viewer. I have a working version using telnet, but I would like to do it all in bash if I can.

jailbait 09-12-2007 07:30 PM

Quote:

Originally Posted by valkarin (Post 2890175)
I read a cool tutorial on socket access in bash, however it requires /dev/tcp or /dev/ucp which do not exist on Debian or Debian based systems (such as Ubuntu). The functionality has to be compiled into bash and the node? has to be present in the system. Is there another method of doing this? I want to write a script that fetches a web page and then pipes it to an html viewer. I have a working version using telnet, but I would like to do it all in bash if I can.

You create /dev entries (nodes) with the mknod command:

http://www.faqs.org/docs/linux_admin/x797.html

man mknod

I think that you create /dev/tcp with:

mknod /dev/tcp c 30 36

I couldn't find the major and minor numbers for /dev/ucp.

-------------------
Steve Stites


All times are GMT -5. The time now is 02:40 PM.