This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

odd sed behavior


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]