X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
X-ME-UUID: 20080919115137193.2F4651C000AB@mwinf1927.orange.fr
Message-ID: <48D39250.9000604@prologue.fr>
Date: Fri, 19 Sep 2008 13:51:44 +0200
From: patrick ficheux <pficheux@prologue.fr>
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: can't redirect sed command to bash script
References: <48D37BF4.4040604@gmail.com>
In-Reply-To: <48D37BF4.4040604@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Bayu Adiwibowo a écrit :
> Hi
>   
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
>   
try

$ sed -f nameState list | ./byState

if byState is in your current directory, it is not neccessary in your PATH


Regards,


--
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/

