public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: odd sed behavior
@ 2000-03-22 10:16 Earnie Boyd
  2000-03-22 11:26 ` Chris Faylor
  0 siblings, 1 reply; 9+ messages in thread
From: Earnie Boyd @ 2000-03-22 10:16 UTC (permalink / raw)
  To: Michael O'Brien, Bob McGowan, cygwin

--- Michael O'Brien <mobrien@pixar.com> wrote:
> Hola~
> 
> This is what I'm doing currently. The sed expression is in a Makefile, so
> the better solutution would be to leave it there as opposed to adding a two
> line file. I'm not trying to be picky, I just want to understand who's
> having problems (sed or the command prompt).
> 

As has already been stated it is the command prompt.  It doesn't understand the
single-quote ' character as a quoting character.  You could try replacing it
with a double-quote " character; but, I have no idea if it will work.  Most
users of Cygwin use it from the bash prompt so there aren't these kinds of
problems.

You could have make create the foo.sed file.

Earnie.

> MO
> 
> ----- Original Message -----
> From: Earnie Boyd <earnie_boyd@yahoo.com>
> To: Michael O'Brien <mobrien@pixar.com>; Bob McGowan <rmcgowan@veritas.com>;
> <cygwin@sourceware.cygnus.com>
> Sent: Wednesday, March 22, 2000 9:51 AM
> Subject: Re: odd sed behavior
> 
> 
> > --- Michael O'Brien <mobrien@pixar.com> wrote:
> > > Hola~
> > >
> > > The command below does work using bash. However, I'm not using bash, but
> the
> > > command prompt. I agree with the diagnosis that the problem lies in the
> ". I
> > > really need a work around, tho.
> > >
> >
> > [edit] foo.sed
> >   s/[\\"]/\\&/g
> >   s/.*/\"&\",/
> >
> > [dos_prompt] sort -u foo.file | sed -f foo.sed
> >
> > [caveat emptor] Untested.
> >
> > Regards,
> >
> >
> > =====
> > ---
> >    Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
> >             __Cygwin: POSIX on Windows__
> > Cygwin Newbies: < http://www.freeyellow.com/members5/gw32/index.html >
> >            __Minimalist GNU for Windows__
> >   Mingw32 List: < http://www.egroups.com/group/mingw32/ >
> >     Mingw Home: < http://www.mingw.org/ >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Talk to your friends online with Yahoo! Messenger.
> > http://im.yahoo.com
> >
> >
> 
> 

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: odd sed behavior
  2000-03-22 10:16 odd sed behavior Earnie Boyd
@ 2000-03-22 11:26 ` Chris Faylor
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Faylor @ 2000-03-22 11:26 UTC (permalink / raw)
  To: cygwin

On Wed, Mar 22, 2000 at 10:16:24AM -0800, Earnie Boyd wrote:
>--- Michael O'Brien <mobrien@pixar.com> wrote:
>> Hola~
>> 
>> This is what I'm doing currently. The sed expression is in a Makefile, so
>> the better solutution would be to leave it there as opposed to adding a two
>> line file. I'm not trying to be picky, I just want to understand who's
>> having problems (sed or the command prompt).
>> 
>
>As has already been stated it is the command prompt.  It doesn't understand the
>single-quote ' character as a quoting character.  You could try replacing it
>with a double-quote " character; but, I have no idea if it will work.  Most
>users of Cygwin use it from the bash prompt so there aren't these kinds of
>problems.

Actually, if this is being called in a Makefile then setting MAKE_MODE=unix
should fix the problem.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: odd sed behavior
  2000-03-22  9:51 Earnie Boyd
@ 2000-03-22 10:08 ` Michael O'Brien
  0 siblings, 0 replies; 9+ messages in thread
From: Michael O'Brien @ 2000-03-22 10:08 UTC (permalink / raw)
  To: earnie_boyd, Bob McGowan, cygwin

Hola~

This is what I'm doing currently. The sed expression is in a Makefile, so
the better solutution would be to leave it there as opposed to adding a two
line file. I'm not trying to be picky, I just want to understand who's
having problems (sed or the command prompt).

MO

----- Original Message -----
From: Earnie Boyd <earnie_boyd@yahoo.com>
To: Michael O'Brien <mobrien@pixar.com>; Bob McGowan <rmcgowan@veritas.com>;
<cygwin@sourceware.cygnus.com>
Sent: Wednesday, March 22, 2000 9:51 AM
Subject: Re: odd sed behavior


> --- Michael O'Brien <mobrien@pixar.com> wrote:
> > Hola~
> >
> > The command below does work using bash. However, I'm not using bash, but
the
> > command prompt. I agree with the diagnosis that the problem lies in the
". I
> > really need a work around, tho.
> >
>
> [edit] foo.sed
>   s/[\\"]/\\&/g
>   s/.*/\"&\",/
>
> [dos_prompt] sort -u foo.file | sed -f foo.sed
>
> [caveat emptor] Untested.
>
> Regards,
>
>
> =====
> ---
>    Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
>             __Cygwin: POSIX on Windows__
> Cygwin Newbies: < http://www.freeyellow.com/members5/gw32/index.html >
>            __Minimalist GNU for Windows__
>   Mingw32 List: < http://www.egroups.com/group/mingw32/ >
>     Mingw Home: < http://www.mingw.org/ >
>
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
>
>


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: odd sed behavior
@ 2000-03-22  9:51 Earnie Boyd
  2000-03-22 10:08 ` Michael O'Brien
  0 siblings, 1 reply; 9+ messages in thread
From: Earnie Boyd @ 2000-03-22  9:51 UTC (permalink / raw)
  To: Michael O'Brien, Bob McGowan, cygwin

--- Michael O'Brien <mobrien@pixar.com> wrote:
> Hola~
> 
> The command below does work using bash. However, I'm not using bash, but the
> command prompt. I agree with the diagnosis that the problem lies in the ". I
> really need a work around, tho.
> 

[edit] foo.sed
  s/[\\"]/\\&/g
  s/.*/\"&\",/

[dos_prompt] sort -u foo.file | sed -f foo.sed

[caveat emptor] Untested.

Regards,


=====
---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://www.freeyellow.com/members5/gw32/index.html >
           __Minimalist GNU for Windows__
  Mingw32 List: < http://www.egroups.com/group/mingw32/ >
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: odd sed behavior
  2000-03-21 18:27   ` Bob McGowan
  2000-03-21 18:33     ` Chris Faylor
@ 2000-03-22  9:33     ` Michael O'Brien
  1 sibling, 0 replies; 9+ messages in thread
From: Michael O'Brien @ 2000-03-22  9:33 UTC (permalink / raw)
  To: Bob McGowan, cygwin

Hola~

The command below does work using bash. However, I'm not using bash, but the
command prompt. I agree with the diagnosis that the problem lies in the ". I
really need a work around, tho.

MO

----- Original Message -----
From: Bob McGowan <rmcgowan@veritas.com>
To: <cygwin@sourceware.cygnus.com>
Sent: Tuesday, March 21, 2000 6:33 PM
Subject: Re: odd sed behavior


> Chris Faylor wrote:
> >
> > On Tue, Mar 21, 2000 at 05:14:28PM -0800, Michael O'Brien wrote:
> > >When using the 20.1 version of cygwin, I'm seeing the following
> > >strange-ness. From the command prompt:
> > >
> > >    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/\"&\",/'
> > >    sed: -e expression #1, char 21: Unterminated `s' command
> > >    The system cannot find the path specified.
> > >
> > >    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/&,/'
> > >
> > >Anyone have any ideas why this doesn't work?
> >
> > I don't believe that B20.1 understands the "'" (apostrophe) quote
> > character.
> >
> > cgf
> >
> > --
> > Want to unsubscribe from this list?
> > Send a message to cygwin-unsubscribe@sourceware.cygnus.com
>
> This is a command prompt (not bash) issue, I believe.  The Windows
> command prompt does not use the single quote (apostrophe) for quoting,
> only double quotes.  The single quotes are probably being passed in to
> sed.
>
> I'd suggest to Michael that you try first starting the bash shell, then
> run the sed command and see what happens.
>
> --
> Bob McGowan
> Staff Software Quality Engineer
> VERITAS Software
> rmcgowan@veritas.com
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
>
>
>


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: odd sed behavior
  2000-03-21 18:27   ` Bob McGowan
@ 2000-03-21 18:33     ` Chris Faylor
  2000-03-22  9:33     ` Michael O'Brien
  1 sibling, 0 replies; 9+ messages in thread
From: Chris Faylor @ 2000-03-21 18:33 UTC (permalink / raw)
  To: cygwin

On Tue, Mar 21, 2000 at 06:33:55PM -0800, Bob McGowan wrote:
>Chris Faylor wrote:
>> 
>> On Tue, Mar 21, 2000 at 05:14:28PM -0800, Michael O'Brien wrote:
>> >When using the 20.1 version of cygwin, I'm seeing the following
>> >strange-ness. From the command prompt:
>> >
>> >    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/\"&\",/'
>> >    sed: -e expression #1, char 21: Unterminated `s' command
>> >    The system cannot find the path specified.
>> >
>> >    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/&,/'
>> >
>> >Anyone have any ideas why this doesn't work?
>> 
>> I don't believe that B20.1 understands the "'" (apostrophe) quote
>> character.
>
>This is a command prompt (not bash) issue, I believe.  The Windows
>command prompt does not use the single quote (apostrophe) for quoting,
>only double quotes.  The single quotes are probably being passed in to
>sed.

Which is kinda what I was driving at.

The snapshots do understand apostrophe as the quote character, FWIW.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: odd sed behavior
  2000-03-21 17:32 ` Chris Faylor
@ 2000-03-21 18:27   ` Bob McGowan
  2000-03-21 18:33     ` Chris Faylor
  2000-03-22  9:33     ` Michael O'Brien
  0 siblings, 2 replies; 9+ messages in thread
From: Bob McGowan @ 2000-03-21 18:27 UTC (permalink / raw)
  To: cygwin

Chris Faylor wrote:
> 
> On Tue, Mar 21, 2000 at 05:14:28PM -0800, Michael O'Brien wrote:
> >When using the 20.1 version of cygwin, I'm seeing the following
> >strange-ness. From the command prompt:
> >
> >    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/\"&\",/'
> >    sed: -e expression #1, char 21: Unterminated `s' command
> >    The system cannot find the path specified.
> >
> >    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/&,/'
> >
> >Anyone have any ideas why this doesn't work?
> 
> I don't believe that B20.1 understands the "'" (apostrophe) quote
> character.
> 
> cgf
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

This is a command prompt (not bash) issue, I believe.  The Windows
command prompt does not use the single quote (apostrophe) for quoting,
only double quotes.  The single quotes are probably being passed in to
sed.

I'd suggest to Michael that you try first starting the bash shell, then
run the sed command and see what happens.

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan@veritas.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: odd sed behavior
  2000-03-21 17:15 Michael O'Brien
@ 2000-03-21 17:32 ` Chris Faylor
  2000-03-21 18:27   ` Bob McGowan
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Faylor @ 2000-03-21 17:32 UTC (permalink / raw)
  To: cygwin

On Tue, Mar 21, 2000 at 05:14:28PM -0800, Michael O'Brien wrote:
>When using the 20.1 version of cygwin, I'm seeing the following
>strange-ness. From the command prompt:
>
>    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/\"&\",/'
>    sed: -e expression #1, char 21: Unterminated `s' command
>    The system cannot find the path specified.
>
>    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/&,/'
>
>Anyone have any ideas why this doesn't work?

I don't believe that B20.1 understands the "'" (apostrophe) quote
character.

cgf


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* odd sed behavior
@ 2000-03-21 17:15 Michael O'Brien
  2000-03-21 17:32 ` Chris Faylor
  0 siblings, 1 reply; 9+ messages in thread
From: Michael O'Brien @ 2000-03-21 17:15 UTC (permalink / raw)
  To: cygwin; +Cc: Michael O'Brien

Hola~

When using the 20.1 version of cygwin, I'm seeing the following
strange-ness. From the command prompt:

    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/\"&\",/'
    sed: -e expression #1, char 21: Unterminated `s' command
    The system cannot find the path specified.

    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g;s/.*/&,/'

Removing the " from the second s// command to sed, the thing works. I've
tried nearly every way I can think of to escape the " (""", \", \\", '"',
etc). I can't figure out a way that works.

    F:\>sort  -u  a.msg  |  sed 's/.*/\"&\",/'

Removed the first s// from the sed command, the thing works.

    F:\>sort  -u  a.msg  | sed 's/[\\"]/\\&/g'

Removing the second s// command, the thing works.

    F:\>sort  -u  a.msg  |  sed 's/[\\"]/\\&/g' | sed 's/.*/\"&\",/'
    sed: can't read |: No such file or directory
    sed: can't read sed: No such file or directory
    sed: can't read s/.*/\": No such file or directory
    The system cannot find the path specified.

Split the two sed commands up.

Anyone have any ideas why this doesn't work?

MO



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2000-03-22 11:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-22 10:16 odd sed behavior Earnie Boyd
2000-03-22 11:26 ` Chris Faylor
  -- strict thread matches above, loose matches on Subject: below --
2000-03-22  9:51 Earnie Boyd
2000-03-22 10:08 ` Michael O'Brien
2000-03-21 17:15 Michael O'Brien
2000-03-21 17:32 ` Chris Faylor
2000-03-21 18:27   ` Bob McGowan
2000-03-21 18:33     ` Chris Faylor
2000-03-22  9:33     ` Michael O'Brien

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).