|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH v2 1/3] qemu-iotests: Modern shellscripting(use $() instead of ``) |
Date: | Thu, 18 Oct 2018 07:46:00 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
[adding Jeff] On 10/18/18 2:14 AM, maozy wrote:
Hi, Eric On 10/18/18 11:28 AM, Eric Blake wrote:On 10/17/18 10:17 PM, Mao Zhongyi wrote:Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere. `pwd` and `basename $0` are in 231 files under directory tests/qemu-iotests, so replaced it with the following: sed -i 's/`pwd`/$(pwd)/g' $(git grep -l "\`pwd\`")No. Instead, I'd rather a separate patch that does: s/`pwd`/$PWD/ s/\$(pwd)/$PWD/since POSIX requires $PWD to be sane, and thus save us a wasted forked process.I got you, thank you very much.
At one point, someone (Jeff?) proposed a cleanup patch that got rid of a lot of cruft in iotests, including the fact that scripts that don't use $seq don't need to assign seq=$(basename $0). We should probably revive that rather than just making pointless churn on stuff that is garbage anyways. But I don't have time to look up a URL to that older series at the moment.I think I might have found this patchset, but it was a long time ago. https://lists.gnu.org/archive/html/qemu-devel/2017-10/msg04056.html
Yes, you found it.
I will remove this patch from this series and resend a separate patch to replace `pwd` and "$(pwd)" with $PWD. Am I right?
That whole series from Jeff should be revived and rebased to master. I don't know if Jeff has time to commit to it any more, so anyone is welcome to pick it up at this point. But your plan in the meantime sounds reasonable.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |