On Tue, Mar 27, 2018 at 6:38 PM, Paul Eggert <[email protected]> wrote: > On 03/27/2018 05:27 PM, Nelson H. F. Beebe wrote: >> >> test=${1##*/} >> >> I would strongly urge removal of such shell extensions. > > That syntax has been standard ever since POSIX formalized the shell in IEEE > Std 1003.2-1992 (I just pulled out my trusty printed copy and checked). It's > a bit of a stretch to call it an "extension" 26 years after standardization.
I would strongly urge not to remove such constructs, but rather to
begin your script with the sourcing of init.sh, which ensures the
remainder of the script is interpreted by a sensible shell.
Alternatively, I could have done this:
test=`echo "$1" |sed 's,.*/,,'`
But that would violate my "don't use backticks" rule, of necessity,
since $(...) probably doesn't work in such an old interpreter. So at
first, I was inclined to include this line at the top:
. "${srcdir=.}/testsuite/init.sh"
But there's an even better solution:
sed-sol10-vs-runtest.diff
Description: Binary data
