[GRASS-dev] Re: [GRASS GIS] #1164: newlines in sed scripts not portable for wingrass

GRASS GIS trac at osgeo.org
Mon Sep 20 15:48:02 EDT 2010


#1164: newlines in sed scripts not portable for wingrass
---------------------------+------------------------------------------------
 Reporter:  hamish         |       Owner:  grass-dev@…              
     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>



More information about the grass-dev mailing list