t2025: Tell tail explicitly to read from stdin

Our current version of bash 3.1.17(5) can not parse the following snippet
correctly
p=abcd
abspath=/$p
subdir="x$(echo "$p" | tail -c $((253 - ${#abspath})))"
as it returns
tail: cannot open `253' for reading: No such file or directory

This is fixed in bash 3.1.20(4), I did not check earlier versions.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
This commit is contained in:
Thomas Braun
2014-09-24 19:42:44 +02:00
committed by Johannes Schindelin
parent 6a2aba2d55
commit f95f06b34e

View File

@@ -63,7 +63,7 @@ test_set_prereq SHORTABSPATH
test_expect_success SHORTABSPATH 'clean up path close to MAX_PATH' '
p=/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef &&
p=y$p$p$p$p &&
subdir="x$(echo "$p" | tail -c $((253 - ${#abspath})))" &&
subdir="x$(echo "$p" | tail -c $((253 - ${#abspath})) - )" &&
# Now, $abspath/$subdir has exactly 254 characters, and is inside CWD
p2="$abspath/$subdir" &&
test 254 = ${#p2} &&