#!/bin/sh if [ $# -eq 1 ]; then TARGETDIR="$1" elif [ $# -eq 0 ]; then TARGETDIR=scripts else exit 2 fi BACKUPSUFFIX=.orig [ -d "$TARGETDIR" ] || exit 1 rm -rf "$TARGETDIR$BACKUPSUFFIX" cp -a "$TARGETDIR" "$TARGETDIR$BACKUPSUFFIX" grep -lr '\\t' "$TARGETDIR" | while read filename; do sed -i '/print_message/s/\\t/${TAB}/g' "$filename" done diff -ur "$TARGETDIR$BACKUPSUFFIX" "$TARGETDIR"