Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <4228D319.24DBAF6D@dessent.net> Date: Fri, 04 Mar 2005 13:28:57 -0800 From: Brian Dessent Organization: My own little world... MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Listing services References: <200503041150 DOT 14903 DOT colin AT breame DOT net> <42289B1B DOT 7000103 AT acm DOT org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com David Rothenberger wrote: > I do it with the following script which uses /proc. That's an interesting script but it has a couple of deficiencies. It does not list services with names that start with a "." and it breaks on services with a space in the name when -n is used. It's also very slow with -n, as there's no need to invoke awk once for each service, and using forking /bin/cat to read each description is costly. Here's a slightly tweaked version that fixes the above problems and runs about 30 times faster. (0m13.722s down to 0m0.489s on my system at least.) #!/bin/sh usage() { cat <