diff --git a/src/cmd/ksh93/tests/path.sh b/src/cmd/ksh93/tests/path.sh index c4255ae21..3f36f72df 100755 --- a/src/cmd/ksh93/tests/path.sh +++ b/src/cmd/ksh93/tests/path.sh @@ -879,7 +879,8 @@ got=$? "(expected $exp, got $got)" # Tests for attempting to use a command name that's too long. -long_cmd=$(awk -v ORS= 'BEGIN { for(i=0;i<500;i++) print "xxxxxxxxxx"; }') +name_max=$(builtin getconf 2>/dev/null; getconf NAME_MAX . 2>/dev/null || echo 255) +long_cmd="$(awk -v ORS= 'BEGIN { for(i=0;i<'$name_max';i++) print "xx"; }')" exp=127 PATH=$PWD $SHELL -c "$long_cmd" > /dev/null 2>&1 got=$?