[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] tracetool: dtrace: handle in and next reser
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] tracetool: dtrace: handle in and next reserved words |
Date: |
Wed, 28 Mar 2012 10:38:25 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0 |
On 03/28/2012 10:26 AM, Lee Essen wrote:
>> + # 'limit', 'in' and 'next' are reserved keywords
>> + if [ "$arg" = "limit" -o "$arg" = "in" -o "$arg" = "next" ]; then
[ ... -o ... ] is not portable. POSIX says you must break it into:
[ ... ] || [ ... ]
or, more efficiently for this particular filtering, rewrite this as:
# munge reserved words
case $arg in
limit | in | next ) arg=_$arg ;;
esac
>
> Could we add 'self' to this list?
and using case makes it easier to add more reserved words:
case $arg in
limit | in | next | self ) arg=_$arg ;;
esac
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature