From 6260614015a181b643670109d65b6e921a90e1e8 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 30 Aug 2010 21:05:25 -0300 Subject: [PATCH] Reduce the number of I/O redirections. - scripts/schhist2web: instead of having many >>"$index", just put one at the enclosing construct --- scripts/schhist2web | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/schhist2web b/scripts/schhist2web index 54f1a70..123457a 100755 --- a/scripts/schhist2web +++ b/scripts/schhist2web @@ -360,17 +360,17 @@ for n in `cd "$dir" && git rev-list $first..HEAD~1` $first; do s="$s" continue fi - echo "$s" >>"$index" + echo "$s" s= empty=false - wrapped_png "$out" "$next" "$m" >>"$index" + wrapped_png "$out" "$next" "$m" done < <(ls -1 "$out/names") if ! $empty; then - echo "$s" >>"$index" - commit_entry "$dir" $next >>"$index" + echo "$s" + commit_entry "$dir" $next fi next=$n -done +done >>"$index" # --- Add creation entries for all files in the first commit ------------------ @@ -378,7 +378,7 @@ done if [ -d "$cache/ppm_$next" ]; then # could this ever be false ? empty=true - echo "" >>"$index" + echo "" mkdir -p "$out/diff_$next" "$out/thumb_$next" while read m; do ppm="$cache/ppm_$next/$m.ppm" @@ -386,7 +386,7 @@ if [ -d "$cache/ppm_$next" ]; then # could this ever be false ? diff="$out/diff_$next/$m.png" thumb="$out/thumb_$next/$m.png" - echo "" >>"$index" + echo "" [ -f "$ppm" ] || continue pngdiff cat "$diff" -f -c 0,1,0 "$ppm" "$ppm" || exit pngdiff shrink "$thumb" -f $THUMB_OPTS -c 0,1,0 "$fat" "$fat" \ @@ -395,13 +395,13 @@ if [ -d "$cache/ppm_$next" ]; then # could this ever be false ? mkdir -p "$out/pdf_$next" schps2pdf -T NEW -o "$out/pdf_$next/$m.pdf" \ "$cache/ps_$next/$m.ps" || exit - wrapped_png "$out" "$next" "$m" >>"$index" + wrapped_png "$out" "$next" "$m" done < <(ls -1 "$out/names") if ! $empty; then - echo "" >>"$index" - commit_entry "$dir" $next >>"$index" + echo "" + commit_entry "$dir" $next fi -fi +fi >>"$index" # --- Finish ------------------------------------------------------------------