From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhu Yijun Subject: Re: [question kvm-unit-tests] issue about exec Date: Wed, 30 Mar 2016 10:54:17 +0800 Message-ID: <56FB3FD9.6000202@huawei.com> References: <56F9116D.5080407@huawei.com> <20160329120343.fnzgckoa3n6vob67@hawk.localdomain> <56FA8679.9060609@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Cc: Andrew Jones , , , Hangaohuai To: Paolo Bonzini Return-path: Received: from szxga02-in.huawei.com ([119.145.14.65]:56445 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754319AbcC3Cyc (ORCPT ); Tue, 29 Mar 2016 22:54:32 -0400 In-Reply-To: <56FA8679.9060609@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2016/3/29 21:43, Paolo Bonzini wrote: > > > On 29/03/2016 14:03, Andrew Jones wrote: >>>> I am running kvm-unit-tests, the Bash(version is low) on my server doesn't support the command 'exec', so I changed some codes in kvm-unit-tests. >> Hmm, I didn't know there were bash versions w/out exec. Is your bash >> really bash? > > It could be the "{fd} http://tiswww.case.edu/php/chet/bash/NEWS was introduced in 4.1: > > ---- > This is a terse description of the new features added to bash-4.1 since > the release of bash-4.0. > > [...] > > p. If the optional left-hand-side of a redirection is of the form > {var}, the shell assigns the file descriptor used to $var or uses $var > as the file descriptor to move or close, depending on the redirection > operator. > ---- > > Yijun, I think using "10" unconditionally would work (i.e. replace {fd} > and $fd with 10). > Yes, it works. Thanks very much! > Paolo > >>>> >>>> diff --git a/scripts/functions.bash b/scripts/functions.bash >>>> index f13fe6f..241ae0e 100644 >>>> --- a/scripts/functions.bash >>>> +++ b/scripts/functions.bash >>>> @@ -12,9 +12,10 @@ function for_each_unittest() >>>> local check >>>> local accel >>>> >>>> - exec {fd}<"$unittests" >>>> + #exec {fd}<"$unittests" > >