Thread (8 messages) flat view 8 messages, 3 authors, 2016-06-15

Re: [PATCH 03/16] more tr portability test script fixes

From: Frank Lichtenheld <hidden>
Date: 2016-06-15 22:44:22

Possibly related (same subject, not in this thread)

On Wed, Mar 12, 2008 at 05:31:06PM -0400, Jeff King wrote:
quoted hunk ↗ jump to hunk
--- a/t/diff-lib.sh
+++ b/t/diff-lib.sh
@@ -21,8 +21,8 @@ compare_diff_raw_z () {
     # Also we do not check SHA1 hash generation in this test, which
     # is a job for t0000-basic.sh
 
-    tr '\000' '\012' <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1
-    tr '\000' '\012' <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2
+    perl -pe 'y/\000/\012/' <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1
+    perl -pe 'y/\000/\012/' <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2
It might make sense performance-wise to integrate the job of the sed call into the perl
call here. Haven't tested it, though.

Gruesse,
-- 
Frank Lichtenheld [off-list ref]
www: http://www.djpig.de/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help