#1164: newlines in sed scripts not portable for wingrass
---------------------------+------------------------------------------------
Reporter: hamish | Owner: grass-...@…
Type: defect | Status: new
Priority: minor | Milestone: 6.4.1
Component: Default | Version: svn-develbranch6
Keywords: wingrass, sed | Platform: MSWindows XP
Cpu: x86-64 |
---------------------------+------------------------------------------------
Comment(by glynn):
Replying to [ticket:1164 hamish]:
> this is not portable for wingrass:
{{{
echo "abc" | sed -e 's|b|\n|'
}}}
> on linux you get the newline:
> but in WinGrass you just get a quoted "n":
It shouldn't work on Linux either; the documentation makes no mention of
"\n" in the replacement. If you want to insert a literal newline, you're
supposed to use backslash-newline, i.e.:
{{{
echo "abc" | sed -e 's|b|\
|'
}}}
which works on both Windows and Linux, and should work according to
[http://www.opengroup.org/onlinepubs/9699919799/utilities/sed.html POSIX].
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1164#comment:1>
GRASS GIS <http://grass.osgeo.org>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev