From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: Stop using "which" in ./configure
Date: Wed, 20 Jan 2010 15:18:53 +0100 [thread overview]
Message-ID: <hj73cd$aie$1@ger.gmane.org> (raw)
In-Reply-To: <20100120134940.GA547@pig.zood.org>
On 01/20/2010 02:49 PM, Loïc Minier wrote:
> On Wed, Jan 20, 2010, Paolo Bonzini wrote:
>> On 01/20/2010 12:37 PM, Loïc Minier wrote:
>>> + # not found
>>> + IFS="$local_ifs"
>> If you do this, you should set IFS to space-tab-lf at the beginning of
>> the script, like this:
>>
>> IFS=" "" ""
>> "
>
> Are you saying that I can't backup/restore IFS without setting it
> first?
Yes, it affects the behavior of read for example:
$ echo a b c | (read a b c; echo $a; echo $b; echo $c)
a
b
c
$ IFS=
$ echo a b c | (read a b c; echo $a; echo $b; echo $c)
a b c
$
(It's not used by QEMU's configure, but it's better to be defensive).
>> or this (better because it does not rely on embedding whitespace
>> characters within the line):
>> IFS=`printf ' \t'`"
>> "
>
> If we go that route, perhaps IFS="`printf ' \t\n'`" would be more
> readable? I'm not sure how common printf is though.
I tried that, but backtick strips trailing newlines (or something like
that but anyway it does not work). IFS=`printf ' \n\t'` would work (the
double quotes are not needed) but the Autoconf manual suggests
space-tab-newline in that order (even though only the leading space
seems important from the rest of the paragraph).
printf is fine, though it may not be a builtin. It's actually more
portable (even if slower on some shells) to use printf than echo if you
have variable substitutions in the string, because it handles
consistently the case when the output starts with a minus sign.
Paolo
next prev parent reply other threads:[~2010-01-20 14:19 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-17 12:45 [Qemu-devel] [PATCH] Check for sdl-config before calling it Loïc Minier
2010-01-17 13:17 ` [Qemu-devel] " Måns Rullgård
2010-01-17 13:43 ` Stefan Weil
2010-01-17 14:39 ` Måns Rullgård
2010-01-19 10:11 ` [Qemu-devel] Stop using "which" in ./configure Loïc Minier
2010-01-19 11:47 ` Loïc Minier
2010-01-19 17:42 ` Stefan Weil
2010-01-20 9:02 ` Loïc Minier
2010-01-19 18:09 ` [Qemu-devel] " Måns Rullgård
2010-01-20 11:37 ` Loïc Minier
2010-01-20 12:19 ` Paolo Bonzini
2010-01-20 13:49 ` Loïc Minier
2010-01-20 14:18 ` Paolo Bonzini [this message]
2010-01-20 16:51 ` Loïc Minier
2010-01-20 18:11 ` Måns Rullgård
2010-01-21 8:44 ` Loïc Minier
2010-01-21 9:48 ` Juan Quintela
2010-01-21 12:14 ` Måns Rullgård
2010-01-26 16:47 ` Loïc Minier
2010-01-26 19:16 ` Blue Swirl
2010-01-27 12:10 ` [Qemu-devel] [PATCH 1/3] Check for sdl-config before calling it Loïc Minier
2010-01-27 12:10 ` [Qemu-devel] [PATCH 2/3] Add and use has() and path_of() funcs Loïc Minier
2010-01-27 12:10 ` [Qemu-devel] [PATCH 3/3] Solaris: test for presence of commands with has() Loïc Minier
2010-01-27 12:47 ` [Qemu-devel] [PATCH 1/3] Check for sdl-config before calling it Ben Taylor
2010-01-27 13:02 ` [Qemu-devel] " Paolo Bonzini
2010-01-27 12:41 ` [Qemu-devel] Re: Stop using "which" in ./configure Loïc Minier
2010-01-27 17:54 ` Blue Swirl
2010-01-28 20:33 ` Loïc Minier
2010-01-28 21:30 ` Blue Swirl
2010-01-21 16:53 ` Jamie Lokier
2010-01-21 20:12 ` Paolo Bonzini
2010-01-20 12:49 ` Juan Quintela
2010-01-20 13:16 ` Paolo Bonzini
2010-01-20 13:54 ` Loïc Minier
2010-01-20 14:06 ` Loïc Minier
2010-01-17 13:36 ` [Qemu-devel] [PATCH] Check for sdl-config before calling it Stefan Weil
2010-01-17 16:06 ` Loïc Minier
2010-01-18 11:35 ` [Qemu-devel] " Paolo Bonzini
-- strict thread matches above, loose matches on Subject: below --
2010-01-19 10:35 [Qemu-devel] Stop using "which" in ./configure Laurent Vivier
2010-01-19 18:01 ` [Qemu-devel] " Måns Rullgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='hj73cd$aie$1@ger.gmane.org' \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).