bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

document another sed portability problem


From: Bruno Haible
Subject: document another sed portability problem
Date: Mon, 24 Jul 2006 14:37:22 +0200
User-agent: KMail/1.9.1

Hi,

Another sed portability problem hit me:

sed -e 'a\
text'

should insert the entire text. But the native sed on MacOS X 10.3 and
10.4 omits the initial whitespace at the beginning of the text line.
Can we document this?

Bruno

*** autoconf.texi       2006-07-24 14:23:19.000000000 +0200
--- autoconf.texi.new   2006-07-24 14:32:23.000000000 +0200
***************
*** 13671,13676 ****
--- 13671,13693 ----
  On the other hand, no white space is allowed between @samp{:} and the
  subsequent label name.
  
+ The @samp{a} command requires a backslash-newline before the text to be
+ added.  Furthermore, if this text starts with whitespace, you need to
+ insert a backslash before it, at the beginning of the line.  This is
+ because otherwise the @command{sed} program on MacOS X 10.4 eats up this
+ whitespace:
+ 
+ @example
+ $ @kbd{echo foo | sed -e 'a\}
+ @kbd{        bar'}
+ foo
+ bar
+ $ @kbd{echo foo | sed -e 'a\}
+ @kbd{\        bar'}
+ foo
+         bar
+ @end example
+ 
  @item @command{sed} (@samp{t})
  @c ---------------------------
  @prindex @command{sed} (@samp{t})




reply via email to

[Prev in Thread] Current Thread [Next in Thread]