Previous Entry | Next Entry

bash is terrifying me again

  • Sep. 7th, 2005 at 3:47 PM
disbelief
:) 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.

Comments

[info]node wrote:
Sep. 7th, 2005 07:56 pm (UTC)
Dude, you have a smiley in your prompt.
[info]mendel wrote:
Sep. 7th, 2005 08:00 pm (UTC)
Blame [info]dagbrown.
:) fishsticks$ false
:( fishsticks$ 
[info]fweebles wrote:
Sep. 7th, 2005 08:08 pm (UTC)
So very wrong.
[info]di1 wrote:
Jan. 7th, 2006 01:14 pm (UTC)
cool :)
[info]crschmidt wrote:
Sep. 8th, 2005 01:15 am (UTC)
I love mendel's true/false smiley prompt!
[info]brianenigma wrote:
Sep. 8th, 2005 02:28 am (UTC)
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!
[info]mendel wrote:
Sep. 8th, 2005 03:58 am (UTC)
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.
[info]vombatus wrote:
Jan. 6th, 2006 08:55 pm (UTC)
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? :)
[info]mendel wrote:
Jan. 7th, 2006 04:45 am (UTC)
It's a bashism.
(Anonymous) wrote:
Jan. 7th, 2006 07:03 pm (UTC)
I found what I am missing. In Debian (and clones) bash is compiled without socket support.

Profile

cat
[info]mendel
Rich Lafferty's LiveJournal
rich text - Rich Lafferty's blog

Latest Month

June 2009
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930    

Tags

Powered by LiveJournal.com
Designed by Tiffany Chow