From 383a9a14acf96b815352c2e39f333b996a96f6ac Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 16 Jul 2022 17:35:33 +0300 Subject: [PATCH 50/50] scripts/replace: Improve style See osdn #45118 Signed-off-by: Marko Lindqvist --- scripts/replace | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/replace b/scripts/replace index a62cd605d2..5fcb5b11fd 100755 --- a/scripts/replace +++ b/scripts/replace @@ -1,15 +1,15 @@ #!/bin/bash -if test "x$1" = "x-h" || test "x$1" = "x--help" || test "x$3" = "x" ; then - echo "Usage: $0 " - exit +if test "$1" = "-h" || test "$1" = "--help" || test "$3" = "" ; then + echo "Usage: $0 " + exit fi -find $1 -name "*.[ch]" | - (while read FILE ; do - if grep "$2" $FILE >/dev/null ; then - echo "Updating $FILE" - sed "s/$2/$3/g" $FILE > $FILE.new - mv $FILE.new $FILE - fi - done ) +find "$1" -name "*.[ch]" | + (while read FILE ; do + if grep "$2" "$FILE" >/dev/null ; then + echo "Updating $FILE" + sed "s/$2/$3/g" "$FILE" > "$FILE.new" + mv "$FILE.new" "$FILE" + fi + done ) -- 2.35.1