From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LNqSj-0002SW-Cc for garchives@archives.gentoo.org; Fri, 16 Jan 2009 15:18:21 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 21DE5E0563; Fri, 16 Jan 2009 15:18:20 +0000 (UTC) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by pigeon.gentoo.org (Postfix) with ESMTP id 0C5D3E0563 for ; Fri, 16 Jan 2009 15:18:20 +0000 (UTC) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id CA1B122D637 for ; Fri, 16 Jan 2009 10:18:19 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 16 Jan 2009 10:18:19 -0500 X-Sasl-enc: xYxhh2cJYTg/+tH1TV9jATHhIlv+LoteibaX8Fj1ubT+ 1232119099 Received: from [10.11.12.87] (nat-pool-rdu.redhat.com [66.187.233.202]) by www.fastmail.fm (Postfix) with ESMTPSA id 628BF24C16 for ; Fri, 16 Jan 2009 10:18:19 -0500 (EST) Subject: Re: [gentoo-user] Bash & Server Sockets From: Albert Hopkins To: gentoo-user@lists.gentoo.org In-Reply-To: References: Content-Type: text/plain Date: Fri, 16 Jan 2009 10:17:47 -0500 Message-Id: <1232119067.2939.2.camel@centar.nbk> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 14762354-69a5-445b-9268-9c7d97ef79ea X-Archives-Hash: 6148fe50f7b466eaa4d0ce1ca5a11cac On Thu, 2009-01-15 at 21:53 -0800, Hilco Wijbenga wrote: > Hi all, > > In Bash /dev/tcp/host/port can be used to write to a TCP socket. This > works nicely so I was very curious whether it would work the other way > too: is it possible to have a Bash script listen on a particular port > as if it were a server? I couldn't find anything in the Bash manual > about it. Google does find a few examples but they all use nc. But > that's cheating! ;-) Is it possible with just Bash, no extra tools? > (If yes, please enlighten me as to how, obviously I could not get it > to work.) ... and some would even say using bash to begin with is cheating.