?

Log in

No account? Create an account
pinkie pie

mendel


Rich Lafferty's Journal

(mendelicious mendelusions)


Previous Entry Share Next Entry
bash is terrifying me again
disbelief
mendel
:) fishsticks$ exec 5<>/dev/tcp/www.perl.org/80
:) fishsticks$ echo -e "GET / HTTP/1.0\nHost: www.perl.org\n\n" >&5
:) fishsticks$ head -1 <&5
HTTP/1.1 200 OK
:) fishsticks$  ls /dev/tcp
ls: /dev/tcp: No such file or directory

Potentially handy, yes, but yeeesh.


  • 1
Dude, you have a smiley in your prompt.

Blame dagbrown.
:) fishsticks$ false
:( fishsticks$ 

I love mendel's true/false smiley prompt!

Maybe I have been stuck in arm-linx-2.4 land and OS X land for too long or maybe I have been using tcsh for too long, but I don't get it. /dev/tcp?

I do get the smiley-return-value thing. I may have to start using something like that!

Maybe I have been stuck in arm-linx-2.4 land and OS X land for too long or maybe I have been using tcsh for too long, but I don't get it. /dev/tcp?

It's just icky but neato! bash now supports sockets, and the syntax for accessing them uses "paths" that don't exist anywhere but in bash's little imagination.

Interesting, but it doesn't work here. What is /dev/tcp/blahblahblah interface? Is it a bashism or OSism? If second what OS? If Linux what am I missing? :)

I found what I am missing. In Debian (and clones) bash is compiled without socket support.

  • 1