test "$(($rlimit/1024))" -gt 120 ||
skip_ 'unable to determine enough resources available'
+cwd=$(pwd)
+
# Without an explicit -S, sort should grow a pipe buffer enough to avoid
# creating a temporary file for this input.
-tac exp | TMPDIR=$PWD/no-temp sort --parallel=1 > out || fail=1
+tac exp | TMPDIR="$cwd"/no-temp sort --parallel=1 > out || fail=1
{ test -s out && compare exp out; } || fail=1
# Check the same path when sort has precomputed key pointers in the
# line table that must be adjusted after the buffer moves.
sed 's/^/k /' exp > exp-key || framework_failure_
-tac exp-key | TMPDIR=$PWD/no-temp sort --parallel=1 -k2,2 > out || fail=1
+tac exp-key | TMPDIR="$cwd"/no-temp sort --parallel=1 -k2,2 > out || fail=1
{ test -s out && compare exp-key out; } || fail=1
# An explicit -S remains a limit for ordinary buffer growth, so this must
# still need a temporary file and fail because TMPDIR is not a directory.
-returns_ 2 env TMPDIR=$PWD/no-temp \
+returns_ 2 env TMPDIR="$cwd"/no-temp \
$SHELL -c 'tac exp | sort --parallel=1 -S 1M > small-out' || fail=1
Exit $fail