Code

t0021: tr portability fix for Solaris
authorJeff King <peff@peff.net>
Tue, 11 Mar 2008 17:40:45 +0000 (13:40 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Mar 2008 04:14:59 +0000 (21:14 -0700)
Solaris' /usr/bin/tr doesn't seem to like multiple character
ranges in brackets (it simply prints "Bad string").

Instead, let's just enumerate the transformation we want.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0021-conversion.sh

index cb860296edfab2d117fc8b62505df00a51baed02..8fc39d77cec6168dae930beef785597dace24aa3 100755 (executable)
@@ -5,7 +5,9 @@ test_description='blob conversion via gitattributes'
 . ./test-lib.sh
 
 cat <<\EOF >rot13.sh
-tr '[a-zA-Z]' '[n-za-mN-ZA-M]'
+tr \
+  'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' \
+  'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM'
 EOF
 chmod +x rot13.sh