On 05/01/08 14:06 +0100, Bram Moolenaar wrote:
>
>An alternative would be to try using NUL characters to separate the
>items.  Unfortunately I could not find a way to make this work for the
>sh of FreeBSD that I'm using.  The builtin echo command accepts -n and
>-e, but not at the same time.  That's weird, but that's how it is.  So
>you could use -e to add a NUL character, but you also get a NL then.
>

Oh, yes, 'echo' is not portable. The printf(1) should be used for this
case. As stated in the SUSV:

http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html

  > APPLICATION USAGE
  >
  >  It is not possible to use echo portably across all POSIX systems
  >  unless both -n (as the first argument) and escape sequences are
  >  omitted.
  >
  >  The printf utility can be used portably to emulate any of the
  >  traditional behaviors of the echo utility ...
 

# tested in FreeBSD, OpenBSD and a Linux
$ for i in * ; do env printf "%s\0" $i; done 

-- 
Dasn


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui