SOggyの日記: bash: /dev/{tcp,udp}
日記 by
SOggy
gniibeさんの日記で気付きました。こんな面白い機能があったなんて。
--enable-net-redirections enable /dev/tcp/host/port redirection
んーと、redir.cんとこだ。おUDPもオッケーそー。ふむtcpdumpで確認。あっはっは、おっもしれー。
TCPつっつくのはtelnet使えばお手軽に出来たけれどUDPでこれほど簡単につっつく方法を知らなかったから、perlでごそごそしてたけれど、こりゃ簡単でいいや。
7/18追記: お手軽に特定ポート向けにUDPが通るか通らないかだけだったら、受け側はtcpdumpで見張りつつ、送り側からnslookupで適当にクエリー出します、はい。もっと簡単な方法はあるかしら?。
8/7追記: しくしく。自分の管理外の端末からudpのテストをしようとしたら、nslookupがまともに使えない。そんな環境知らんよ、俺は。ちゃんと設定せいよ。
2005/1/26追記: README.Debian抜粋
Why is bash configured with --disable-net-redirections?
It can produce completely unexpected results. This kind of feature should not be part of a shell but a special. tool. And that tool has existed for years already, it's called netcat.
まー、そりゃもっともなんだが。
bash: /dev/{tcp,udp} More ログイン