:) 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.
11 responses to “bash is terrifying me again”
Dude, you have a smiley in your prompt.
Blame Dagbrown.
So very wrong.
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? :)
It’s a bashism.
cool :)
I found what I am missing. In Debian (and clones) bash is compiled without socket support.
It’s not just a bash-ism. It’s in ksh too.
Don’t know where it appeared first.