From 85ca4f0294249ba21e72357bedc4e9f7935d2858 Mon Sep 17 00:00:00 2001 From: "Barak A. Pearlmutter" Date: Thu, 14 Apr 2011 09:57:19 +0100 Subject: [PATCH] switch old deprecated sh syntax `...` to new approved $(...) --- hg-fast-export.sh | 10 +++++----- hg-reset.sh | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hg-fast-export.sh b/hg-fast-export.sh index 59d3237..29bf22b 100755 --- a/hg-fast-export.sh +++ b/hg-fast-export.sh @@ -3,7 +3,7 @@ # Copyright (c) 2007, 2008 Rocco Rutte and others. # License: MIT -ROOT="`dirname $0`" +ROOT="$(dirname $0)" REPO="" PFX="hg2git" SFX_MAPPING="mapping" @@ -64,7 +64,7 @@ done # for convenience: get default repo from state file if [ x"$REPO" = x -a -f "$GIT_DIR/$PFX-$SFX_STATE" ] ; then - REPO="`egrep '^:repo ' "$GIT_DIR/$PFX-$SFX_STATE" | cut -d ' ' -f 2`" + REPO="$(egrep '^:repo ' "$GIT_DIR/$PFX-$SFX_STATE" | cut -d ' ' -f 2)" echo "Using last hg repository \"$REPO\"" fi @@ -98,10 +98,10 @@ cat "$GIT_DIR/$PFX-$SFX_MARKS.old" "$GIT_DIR/$PFX-$SFX_MARKS.tmp" \ # save SHA1s of current heads for incremental imports # and connectivity (plus sanity checking) -for head in `git branch | sed 's#^..##'` ; do - id="`git rev-parse $head`" +for head in $(git branch | sed 's#^..##') ; do + id="$(git rev-parse $head)" echo ":$head $id" done > "$GIT_DIR/$PFX-$SFX_HEADS" # check diff with color: -# ( for i in `find . -type f | grep -v '\.git'` ; do diff -u $i $REPO/$i ; done | cdiff ) | less -r +# ( for i in $(find . -type f | grep -v '\.git') ; do diff -u $i $REPO/$i ; done | cdiff ) | less -r diff --git a/hg-reset.sh b/hg-reset.sh index c77c291..3b2294c 100755 --- a/hg-reset.sh +++ b/hg-reset.sh @@ -3,7 +3,7 @@ # Copyright (c) 2007, 2008 Rocco Rutte and others. # License: MIT -ROOT="`dirname $0`" +ROOT="$(dirname $0)" REPO="" PFX="hg2git" SFX_MARKS="marks" @@ -47,7 +47,7 @@ done # for convenience: get default repo from state file if [ x"$REPO" = x -a -f "$GIT_DIR/$PFX-$SFX_STATE" ] ; then - REPO="`egrep '^:repo ' "$GIT_DIR/$PFX-$SFX_STATE" | cut -d ' ' -f 2`" + REPO="$(egrep '^:repo ' "$GIT_DIR/$PFX-$SFX_STATE" | cut -d ' ' -f 2)" echo "Using last hg repository \"$REPO\"" fi -- 2.11.4.GIT