Re: sed bug causing build failure?
- Johnston D Johnston wrote:
> On Wed, 24 Dec 2003 15:00:03 +0100,If you use backticks like that, the shell will remove the (trailing)
> Bram Moolenaar <Bram@...> wrote:
> > Mark Waggoner wrote:
> > > I needed to modify this to be:
> > >
> > > perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
> > > -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//'`
> > Why doesn't Perl add a newline after the text it writes to stdout?
> > Anyway, that's how it is.
> It's a *good* thing that Perl doesn't add a newline. The output of the
> subs ccflags(), perl_inc(), ldopts(), &c. was designed to be "glued"
> into a cc command line, such as:
> cc -o prog prog.c `perl -MExtUtils::Embed -e ccflags -e ldopts`
> Naturally, you wouldn't want newlines in the middle of your cc command.
newline for you. Most commands add line breaks, thus the shell removes
Try this with a short "file" that contains line breaks:
echo `cat file`
It will display a single line.
Thus Perl should add a newline in that output.
From "know your smileys":
*<|:-) Santa Claus (Ho Ho Ho)
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///