On 03/19/2014 08:45 AM, Jeff Cody wrote: >> >> ${@: -1} is not portable: >>
> > Yes, and there are likely other bash-isms in some of the shell > scripts in qemu-iotests. Since #!/bin/bash is explicitly specified, > it seems reasonable that bash-isms would be allowed. Ah, indeed, I missed the shebang line. Where we KNOW we are using bash, I have no problem using the additional features that bash gives us as a guarantee. > But I think in your next message you have a nice POSIX compatible > method of doing it with shifts, and it is probably best to default to > POSIX when practical. I'll go ahead and change it to the > 'shift $(($# - 1))' method. Where the portable way doesn't cost any additional forks, then yes, I agree that being portable is nice for the sake of anyone copying-and-pasting from our explicit bash script over to a more generic /bin/sh script. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature