X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <48D37BF4.4040604@gmail.com> Date: Fri, 19 Sep 2008 17:16:20 +0700 From: Bayu Adiwibowo Reply-To: bayuadi DOT w AT gmail DOT com User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: can't redirect sed command to bash script Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Hi I want using sed and redirect with pipe bash script to produce report that sort names by state and list the name of state followed by name of each person in that state. It's work in linux as expected but cygwin seen can't executed bash script in such way. This is my test script $ cat nameState s/ CA/, California/ s/ MA/, Massachusetts/ s/ OK/, Oklahoma/ s/ PA/, Pennsylvania/ s/ VA/, Virginia/ $ cat list John Daggett, 341 King Road, Plymouth MA Alice Ford, 22 East Broadway, Richmond VA Orville Thomas, 11345 Oak Bridge Road, Tulsa OK Terry Kalkas, 402 Lans Road, Beaver Falls PA Eric Adams, 20 Post Road, Sudbury MA Hubert Sims, 328A Brook Road, Roanoke VA Amy Wilde, 334 Bayshore Pkwy, Mountain View CA Sal Carpenter, 73 6th Street, Boston MA $ cat byState #! /bin/sh awk -F, '{ print $4 ", " $0 }' $* | sort | awk -F, ' $1 == LastState { print "\t" $2 } $1 != LastState { LastState = $1 print $1 }' Bash can't executed with following error $ sed -f nameState list | byState bash: byState: command not found -- 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/