X-Spam-Check-By: sourceware.org In-Reply-To: <002d01c26904$36f1ff10$176196d4@5at8s8cqeex4qhi> References: <002d01c26904$36f1ff10$176196d4 AT 5at8s8cqeex4qhi> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Cc: Alex Vinokur Content-Transfer-Encoding: 7bit From: charles Bobo Subject: Re: man : List of all commands in a section Date: Fri, 29 Dec 2006 21:43:16 -0500 To: cygwin AT cygwin DOT com X-Mailer: Apple Mail (2.752.2) X-Brightmail-scanned: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Oct 1, 2002, at 12:37 AM, Alex Vinokur wrote: > ============= > Windows 2000 > CYGWIN_NT-5.0 > ============= > > Is it possible to get list of > * all section > * all commands in some section ? > > > ================== > Alex Vinokur > mailto:alexvn AT go DOT to > http://up.to/alexvn > ================== > > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Bug reporting: http://cygwin.com/bugs.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > Here is a shell script I wrote to list all commands in the PATH: =========== snip ============ #!/bin/sh # list all commands: list all executable commands in the current PATH. myPATH="$(echo $PATH | sed -e 's/ /~~/g' -e 's/:/ /g')" count=0; cmdlist=""; for dirname in $myPATH ; do directory="$(echo $dirname | sed 's/~~/ /g')" if [ -d "$directory" ] ; then for command in $(ls "$directory") ; do if [ -x "$directory/$command" ] ; then count="$(( $count + 1 ))" cmdlist="$cmdlist $command" fi done fi done #echo "$count commands:" for cmd in $cmdlist ; do echo $cmd done =========== snip ============ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/