From: Eric Blake <eblake@redhat.com>
To: unai.martinezcorral@ehu.eus
Cc: qemu-devel@nongnu.org, riku.voipio@iki.fi, laurent@vivier.eu
Subject: Re: [Qemu-devel] [PATCH] qemu-binfmt-conf.sh: add CPUS, add --reset, make -p and -c boolean (no arg)
Date: Tue, 5 Mar 2019 13:20:11 -0600 [thread overview]
Message-ID: <3249d2a0-f981-9da1-c4a0-f61dc0acd66d@redhat.com> (raw)
In-Reply-To: <CAGZZdDEp7vxzxbWoHn5AF3g28FKSwka1WQB=U5MTv6X=XLeL7A@mail.gmail.com>
On 3/5/19 1:15 PM, Unai Martinez Corral wrote:
>>> + find /proc/sys/fs/binfmt_misc/ -type f -name 'qemu-*' -exec sh -c
>>> 'echo -1 > {}' \;
>>
>> echo -1 is not portable (you are not guaranteed that echo won't try to
>> treat it as an option); better would be using printf.
>
> Incidentally, I tried with MSYS2 and fedora:29 docker container. On
> both of them , 'echo -1' works, while 'printf -1' does not. Anyway, I
> replaced it with 'printf %s -1'. Hope it is ok.
You are correct that 'printf -1' is likely to fail, 'printf -- -1' is
portable but unusual, and 'printf %s\\n -1' is identical to the common
(but non-portable) behavior of 'echo -1'. Is the newline important?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2019-03-05 19:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-05 6:28 [Qemu-devel] [PATCH] qemu-binfmt-conf.sh: add CPUS, add --reset, make -p and -c boolean (no arg) Unai Martinez Corral
2019-03-05 15:35 ` Unai Martinez Corral
2019-03-05 16:44 ` Unai Martinez Corral
2019-03-05 16:57 ` Eric Blake
2019-03-05 19:15 ` Unai Martinez Corral
2019-03-05 19:20 ` Eric Blake [this message]
2019-03-05 19:36 ` Unai Martinez Corral
2019-03-05 19:57 ` Eric Blake
2019-03-05 19:32 ` [Qemu-devel] [PATCH v2] " Unai Martinez Corral
2019-03-05 19:54 ` Eric Blake
2019-03-05 20:28 ` Unai Martinez Corral
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=3249d2a0-f981-9da1-c4a0-f61dc0acd66d@redhat.com \
--to=eblake@redhat.com \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=unai.martinezcorral@ehu.eus \
/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).