{"thread":{"id":"11906","subject":"[PATCH] shell scripts: Use POSIX/Susv command substitution instead of backticks","startedAt":"2008-02-05T23:37:58Z","lastAt":"2008-02-05T23:37:58Z","messageCount":1,"participants":["Jari Aalto"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"67579","messageId":"63x3x9d5.fsf@blue.sea.net","threadId":"11906","inReplyTo":null,"subject":"[PATCH] shell scripts: Use POSIX/Susv command substitution instead of backticks","fromName":"Jari Aalto","fromEmail":"jari.aalto@cante.net","sentAt":"2008-02-05T23:37:58Z","receivedAt":"2008-02-05T23:37:58Z","isPatch":true,"sender":{"key":"jari.aalto@cante.net","avatar":"https://avatars.githubusercontent.com/u/34601?v=4"},"body":"Use redable $(<command>) syntax instead of backtics in code.  See The\nOpen Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition\n\nSigned-off-by: Jari Aalto <jari.aalto AT cante.net>\n---\n NOTE: git-rebase.sh has been handled / submitted in earlier patch.\n\n check-builtins.sh     |    4 ++--\n git-am.sh             |   27 ++++++++++++++-------------\n git-bisect.sh         |    4 ++--\n git-checkout.sh       |    8 ++++----\n git-clone.sh          |   20 ++++++++++----------\n git-help--browse.sh   |    6 +++---\n git-instaweb.sh       |   22 +++++++++++-----------\n git-merge-octopus.sh  |    2 +-\n git-merge-one-file.sh |   12 ++++++------\n git-merge-stupid.sh   |    2 +-\n git-merge.sh          |    9 +++++----\n git-mergetool.sh      |   16 ++++++++--------\n git-parse-remote.sh   |    2 +-\n git-pull.sh           |    2 +-\n git-repack.sh         |    8 ++++----\n git-request-pull.sh   |    6 +++---\n git-submodule.sh      |    2 +-\n test-sha1.sh          |    8 ++++----\n 18 files changed, 81 insertions(+), 79 deletions(-)\n\ndiff --git a/check-builtins.sh b/check-builtins.sh\nindex d6fe6cf..07cff69 100755\n--- a/check-builtins.sh\n+++ b/check-builtins.sh\n@@ -14,8 +14,8 @@ sort |\n     bad=0\n     while read builtin\n     do\n-\tbase=`expr \"$builtin\" : 'git-\\(.*\\)'`\n-\tx=`sed -ne 's/.*{ \"'$base'\", \\(cmd_[^, ]*\\).*/'$base'\t\\1/p' git.c`\n+\tbase=$(expr \"$builtin\" : 'git-\\(.*\\)')\n+\tx=$(sed -ne 's/.*{ \"'$base'\", \\(cmd_[^, ]*\\).*/'$base'\t\\1/p' git.c)\n \tif test -z \"$x\"\n \tthen\n \t\techo \"$base is builtin but not listed in git.c command list\"\ndiff --git a/git-am.sh b/git-am.sh\nindex 5f0f241..4e41243 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -71,7 +71,7 @@ cannot_fallback () {\n }\n \n fall_back_3way () {\n-    O_OBJECT=`cd \"$GIT_OBJECT_DIRECTORY\" && pwd`\n+    O_OBJECT=$(cd \"$GIT_OBJECT_DIRECTORY\" && pwd)\n \n     rm -fr \"$dotest\"/patch-merge-*\n     mkdir \"$dotest/patch-merge-tmp-dir\"\n@@ -243,23 +243,23 @@ if test \"$(cat \"$dotest/keep\")\" = t\n then\n \tkeep=-k\n fi\n-ws=`cat \"$dotest/whitespace\"`\n+ws=$(cat \"$dotest/whitespace\")\n if test \"$(cat \"$dotest/sign\")\" = t\n then\n-\tSIGNOFF=`git-var GIT_COMMITTER_IDENT | sed -e '\n+\tSIGNOFF=$(git-var GIT_COMMITTER_IDENT | sed -e '\n \t\t\ts/>.*/>/\n \t\t\ts/^/Signed-off-by: /'\n-\t\t`\n+\t\t)\n else\n \tSIGNOFF=\n fi\n \n-last=`cat \"$dotest/last\"`\n-this=`cat \"$dotest/next\"`\n+last=$(cat \"$dotest/last\")\n+this=$(cat \"$dotest/next\")\n if test \"$skip\" = t\n then\n \tgit rerere clear\n-\tthis=`expr \"$this\" + 1`\n+\tthis=$(expr \"$this\" + 1)\n \tresume=\n fi\n \n@@ -272,8 +272,8 @@ fi\n \n while test \"$this\" -le \"$last\"\n do\n-\tmsgnum=`printf \"%0${prec}d\" $this`\n-\tnext=`expr \"$this\" + 1`\n+\tmsgnum=$(printf \"%0${prec}d\" $this)\n+\tnext=$(expr \"$this\" + 1)\n \ttest -f \"$dotest/$msgnum\" || {\n \t\tresume=\n \t\tgo_next\n@@ -326,16 +326,17 @@ do\n \t'')\n \t    if test '' != \"$SIGNOFF\"\n \t    then\n-\t\tLAST_SIGNED_OFF_BY=`\n+\t\tLAST_SIGNED_OFF_BY=$(\n \t\t    sed -ne '/^Signed-off-by: /p' \\\n \t\t    \"$dotest/msg-clean\" |\n \t\t    tail -n 1\n-\t\t`\n-\t\tADD_SIGNOFF=`\n+\t\t)\n+\t\tADD_SIGNOFF=$(\n \t\t    test \"$LAST_SIGNED_OFF_BY\" = \"$SIGNOFF\" || {\n \t\t    test '' = \"$LAST_SIGNED_OFF_BY\" && echo\n \t\t    echo \"$SIGNOFF\"\n-\t\t}`\n+\t\t    }\n+\t\t)\n \t    else\n \t\tADD_SIGNOFF=\n \t    fi\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 5385249..a97f2b2 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -64,7 +64,7 @@ bisect_start() {\n \tcase \"$head\" in\n \trefs/heads/bisect)\n \t\tif [ -s \"$GIT_DIR/head-name\" ]; then\n-\t\t    branch=`cat \"$GIT_DIR/head-name\"`\n+\t\t    branch=$(cat \"$GIT_DIR/head-name\")\n \t\telse\n \t\t    branch=master\n \t\tfi\n@@ -350,7 +350,7 @@ bisect_reset() {\n \t}\n \tcase \"$#\" in\n \t0) if [ -s \"$GIT_DIR/head-name\" ]; then\n-\t       branch=`cat \"$GIT_DIR/head-name\"`\n+\t       branch=$(cat \"$GIT_DIR/head-name\")\n \t   else\n \t       branch=master\n \t   fi ;;\ndiff --git a/git-checkout.sh b/git-checkout.sh\nindex 5621c69..23d3a7d 100755\n--- a/git-checkout.sh\n+++ b/git-checkout.sh\n@@ -218,7 +218,7 @@ else\n \n \t# Match the index to the working tree, and do a three-way.\n \tgit diff-files --name-only | git update-index --remove --stdin &&\n-\twork=`git write-tree` &&\n+\twork=$(git write-tree) &&\n \tgit read-tree $v --reset -u $new || exit\n \n \teval GITHEAD_$new='${new_name:-${branch:-$new}}' &&\n@@ -229,7 +229,7 @@ else\n \t# Do not register the cleanly merged paths in the index yet.\n \t# this is not a real merge before committing, but just carrying\n \t# the working tree changes along.\n-\tunmerged=`git ls-files -u`\n+\tunmerged=$(git ls-files -u)\n \tgit read-tree $v --reset $new\n \tcase \"$unmerged\" in\n \t'')\t;;\n@@ -265,7 +265,7 @@ if [ \"$?\" -eq 0 ]; then\n \tfi\n \tif test -n \"$branch\"\n \tthen\n-\t\told_branch_name=`expr \"z$oldbranch\" : 'zrefs/heads/\\(.*\\)'`\n+\t\told_branch_name=$(expr \"z$oldbranch\" : 'zrefs/heads/\\(.*\\)')\n \t\tGIT_DIR=\"$GIT_DIR\" git symbolic-ref -m \"checkout: moving from ${old_branch_name:-$old} to $branch\" HEAD \"refs/heads/$branch\"\n \t\tif test -n \"$quiet\"\n \t\tthen\n@@ -278,7 +278,7 @@ if [ \"$?\" -eq 0 ]; then\n \t\tfi\n \telif test -n \"$detached\"\n \tthen\n-\t\told_branch_name=`expr \"z$oldbranch\" : 'zrefs/heads/\\(.*\\)'`\n+\t\told_branch_name=$(expr \"z$oldbranch\" : 'zrefs/heads/\\(.*\\)')\n \t\tgit update-ref --no-deref -m \"checkout: moving from ${old_branch_name:-$old} to $arg\" HEAD \"$detached\" ||\n \t\t\tdie \"Cannot detach HEAD\"\n \t\tif test -n \"$detach_warn\"\ndiff --git a/git-clone.sh b/git-clone.sh\nindex b4e858c..97831ab 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -40,7 +40,7 @@ eval \"$(echo \"$OPTIONS_SPEC\" | git rev-parse --parseopt -- \"$@\" || echo exit $?)\n \n get_repo_base() {\n \t(\n-\t\tcd \"`/bin/pwd`\" &&\n+\t\tcd \"$(/bin/pwd)\" &&\n \t\tcd \"$1\" || cd \"$1.git\" &&\n \t\t{\n \t\t\tcd .git\n@@ -50,7 +50,7 @@ get_repo_base() {\n }\n \n if [ -n \"$GIT_SSL_NO_VERIFY\" -o \\\n-\t\"`git config --bool http.sslVerify`\" = false ]; then\n+\t\"$(git config --bool http.sslVerify)\" = false ]; then\n     curl_extra_args=\"-k\"\n fi\n \n@@ -70,7 +70,7 @@ clone_dumb_http () {\n \tclone_tmp=\"$GIT_DIR/clone-tmp\" &&\n \tmkdir -p \"$clone_tmp\" || exit 1\n \tif [ -n \"$GIT_CURL_FTP_NO_EPSV\" -o \\\n-\t\t\"`git config --bool http.noEPSV`\" = true ]; then\n+\t\t\"$(git config --bool http.noEPSV)\" = true ]; then\n \t\tcurl_extra_args=\"${curl_extra_args} --disable-epsv\"\n \tfi\n \thttp_fetch \"$1/info/refs\" \"$clone_tmp/refs\" ||\n@@ -79,7 +79,7 @@ Perhaps git-update-server-info needs to be run there?\"\n \ttest \"z$quiet\" = z && v=-v || v=\n \twhile read sha1 refname\n \tdo\n-\t\tname=`expr \"z$refname\" : 'zrefs/\\(.*\\)'` &&\n+\t\tname=$(expr \"z$refname\" : 'zrefs/\\(.*\\)') &&\n \t\tcase \"$name\" in\n \t\t*^*)\tcontinue;;\n \t\tesac\n@@ -88,7 +88,7 @@ Perhaps git-update-server-info needs to be run there?\"\n \t\t*)\tcontinue ;;\n \t\tesac\n \t\tif test -n \"$use_separate_remote\" &&\n-\t\t   branch_name=`expr \"z$name\" : 'zheads/\\(.*\\)'`\n+\t\t   branch_name=$(expr \"z$name\" : 'zheads/\\(.*\\)')\n \t\tthen\n \t\t\ttname=\"remotes/$origin/$branch_name\"\n \t\telse\n@@ -100,7 +100,7 @@ Perhaps git-update-server-info needs to be run there?\"\n \thttp_fetch \"$1/HEAD\" \"$GIT_DIR/REMOTE_HEAD\" ||\n \trm -f \"$GIT_DIR/REMOTE_HEAD\"\n \tif test -f \"$GIT_DIR/REMOTE_HEAD\"; then\n-\t\thead_sha1=`cat \"$GIT_DIR/REMOTE_HEAD\"`\n+\t\thead_sha1=$(cat \"$GIT_DIR/REMOTE_HEAD\")\n \t\tcase \"$head_sha1\" in\n \t\t'ref: refs/'*)\n \t\t\t;;\n@@ -413,15 +413,15 @@ if test -z \"$bare\" && test -f \"$GIT_DIR/REMOTE_HEAD\"\n then\n \t# a non-bare repository is always in separate-remote layout\n \tremote_top=\"refs/remotes/$origin\"\n-\thead_sha1=`cat \"$GIT_DIR/REMOTE_HEAD\"`\n+\thead_sha1=$(cat \"$GIT_DIR/REMOTE_HEAD\")\n \tcase \"$head_sha1\" in\n \t'ref: refs/'*)\n \t\t# Uh-oh, the remote told us (http transport done against\n \t\t# new style repository with a symref HEAD).\n \t\t# Ideally we should skip the guesswork but for now\n \t\t# opt for minimum change.\n-\t\thead_sha1=`expr \"z$head_sha1\" : 'zref: refs/heads/\\(.*\\)'`\n-\t\thead_sha1=`cat \"$GIT_DIR/$remote_top/$head_sha1\"`\n+\t\thead_sha1=$(expr \"z$head_sha1\" : 'zref: refs/heads/\\(.*\\)')\n+\t\thead_sha1=$(cat \"$GIT_DIR/$remote_top/$head_sha1\")\n \t\t;;\n \tesac\n \n@@ -436,7 +436,7 @@ then\n \t\twhile read name\n \t\tdo\n \t\t\ttest t = $done && continue\n-\t\t\tbranch_tip=`cat \"$GIT_DIR/$remote_top/$name\"`\n+\t\t\tbranch_tip=$(cat \"$GIT_DIR/$remote_top/$name\")\n \t\t\tif test \"$head_sha1\" = \"$branch_tip\"\n \t\t\tthen\n \t\t\t\techo \"$name\"\ndiff --git a/git-help--browse.sh b/git-help--browse.sh\nindex 10b0a36..85e16c5 100755\n--- a/git-help--browse.sh\n+++ b/git-help--browse.sh\n@@ -39,7 +39,7 @@ valid_tool() {\n }\n \n init_browser_path() {\n-\tbrowser_path=`git config browser.$1.path`\n+\tbrowser_path=$(git config browser.$1.path)\n \ttest -z \"$browser_path\" && browser_path=$1\n }\n \n@@ -49,7 +49,7 @@ do\n \t-b|--browser*|-t|--tool*)\n \t    case \"$#,$1\" in\n \t\t*,*=*)\n-\t\t    browser=`expr \"z$1\" : 'z-[^=]*=\\(.*\\)'`\n+\t\t    browser=$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)')\n \t\t    ;;\n \t\t1,*)\n \t\t    usage ;;\n@@ -75,7 +75,7 @@ if test -z \"$browser\"\n then\n     for opt in \"help.browser\" \"web.browser\"\n     do\n-\tbrowser=\"`git config $opt`\"\n+\tbrowser=\"$(git config $opt)\"\n \ttest -z \"$browser\" || break\n     done\n     if test -n \"$browser\" && ! valid_tool \"$browser\"; then\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex 3e4452b..fb61afe 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -22,12 +22,12 @@ restart        restart the web server\n . git-sh-setup\n \n fqgitdir=\"$GIT_DIR\"\n-local=\"`git config --bool --get instaweb.local`\"\n-httpd=\"`git config --get instaweb.httpd`\"\n-browser=\"`git config --get instaweb.browser`\"\n-test -z \"$browser\" && browser=\"`git config --get web.browser`\"\n-port=`git config --get instaweb.port`\n-module_path=\"`git config --get instaweb.modulepath`\"\n+local=\"$(git config --bool --get instaweb.local)\"\n+httpd=\"$(git config --get instaweb.httpd)\"\n+browser=\"$(git config --get instaweb.browser)\"\n+test -z \"$browser\" && browser=\"$(git config --get web.browser)\"\n+port=$(git config --get instaweb.port)\n+module_path=\"$(git config --get instaweb.modulepath)\"\n \n conf=\"$GIT_DIR/gitweb/httpd.conf\"\n \n@@ -43,7 +43,7 @@ test -z \"$browser\" && browser='firefox'\n test -z \"$port\" && port=1234\n \n start_httpd () {\n-\thttpd_only=\"`echo $httpd | cut -f1 -d' '`\"\n+\thttpd_only=\"$(echo $httpd | cut -f1 -d' ')\"\n \tif case \"$httpd_only\" in /*) : ;; *) which $httpd_only >/dev/null;; esac\n \tthen\n \t\t$httpd \"$fqgitdir/gitweb/httpd.conf\"\n@@ -73,7 +73,7 @@ start_httpd () {\n }\n \n stop_httpd () {\n-\ttest -f \"$fqgitdir/pid\" && kill `cat \"$fqgitdir/pid\"`\n+\ttest -f \"$fqgitdir/pid\" && kill $(cat \"$fqgitdir/pid\")\n }\n \n while test $# != 0\n@@ -121,7 +121,7 @@ do\n done\n \n mkdir -p \"$GIT_DIR/gitweb/tmp\"\n-GIT_EXEC_PATH=\"`git --exec-path`\"\n+GIT_EXEC_PATH=\"$(git --exec-path)\"\n GIT_DIR=\"$fqgitdir\"\n export GIT_EXEC_PATH GIT_DIR\n \n@@ -220,7 +220,7 @@ PerlPassEnv GIT_EXEC_DIR\n EOF\n \telse\n \t\t# plain-old CGI\n-\t\tlist_mods=`echo \"$httpd\" | sed \"s/-f$/-l/\"`\n+\t\tlist_mods=$(echo \"$httpd\" | sed \"s/-f$/-l/\")\n \t\t$list_mods | grep 'mod_cgi\\.c' >/dev/null 2>&1 || \\\n \t\techo \"LoadModule cgi_module $module_path/mod_cgi.so\" >> \"$conf\"\n \t\tcat >> \"$conf\" <<EOF\n@@ -275,7 +275,7 @@ webrick)\n esac\n \n init_browser_path() {\n-\tbrowser_path=\"`git config browser.$1.path`\"\n+\tbrowser_path=\"$(git config browser.$1.path)\"\n \ttest -z \"$browser_path\" && browser_path=\"$1\"\n }\n \ndiff --git a/git-merge-octopus.sh b/git-merge-octopus.sh\nindex 645e114..c3fb628 100755\n--- a/git-merge-octopus.sh\n+++ b/git-merge-octopus.sh\n@@ -71,7 +71,7 @@ do\n \t\t;;\n \tesac\n \n-\tCNT=`expr $CNT + 1`\n+\tCNT=$(expr $CNT + 1)\n \tPARENT=\"$PARENT -p $SHA1\"\n \n \tif test \"$common,$NON_FF_MERGE\" = \"$MRC,0\"\ndiff --git a/git-merge-one-file.sh b/git-merge-one-file.sh\nindex 9ee3f80..06146f6 100755\n--- a/git-merge-one-file.sh\n+++ b/git-merge-one-file.sh\n@@ -86,16 +86,16 @@ case \"${1:-.}${2:-.}${3:-.}\" in\n \t\t;;\n \tesac\n \n-\tsrc2=`git-unpack-file $3`\n+\tsrc2=$(git-unpack-file $3)\n \tcase \"$1\" in\n \t'')\n \t\techo \"Added $4 in both, but differently.\"\n \t\t# This extracts OUR file in $orig, and uses git apply to\n \t\t# remove lines that are unique to ours.\n-\t\torig=`git-unpack-file $2`\n-\t\tsz0=`wc -c <\"$orig\"`\n+\t\torig=$(git-unpack-file $2)\n+\t\tsz0=$(wc -c <\"$orig\")\n \t\tdiff -u -La/$orig -Lb/$orig $orig $src2 | git apply --no-add\n-\t\tsz1=`wc -c <\"$orig\"`\n+\t\tsz1=$(wc -c <\"$orig\")\n \n \t\t# If we do not have enough common material, it is not\n \t\t# worth trying two-file merge using common subsections.\n@@ -103,13 +103,13 @@ case \"${1:-.}${2:-.}${3:-.}\" in\n \t\t;;\n \t*)\n \t\techo \"Auto-merging $4\"\n-\t\torig=`git-unpack-file $1`\n+\t\torig=$(git-unpack-file $1)\n \t\t;;\n \tesac\n \n \t# Be careful for funny filename such as \"-L\" in \"$4\", which\n \t# would confuse \"merge\" greatly.\n-\tsrc1=`git-unpack-file $2`\n+\tsrc1=$(git-unpack-file $2)\n \tgit merge-file \"$src1\" \"$orig\" \"$src2\"\n \tret=$?\n \ndiff --git a/git-merge-stupid.sh b/git-merge-stupid.sh\nindex f612d47..e0239dc 100755\n--- a/git-merge-stupid.sh\n+++ b/git-merge-stupid.sh\n@@ -43,7 +43,7 @@ case \"$bases\" in\n \t\tGIT_INDEX_FILE=$G git read-tree -m $c $head $remotes \\\n \t\t\t 2>/dev/null ||\tcontinue\n \t\t# Count the paths that are unmerged.\n-\t\tcnt=`GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l`\n+\t\tcnt=$(GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l)\n \t\tif test $best_cnt -le 0 -o $cnt -le $best_cnt\n \t\tthen\n \t\t\tbest=$c\ndiff --git a/git-merge.sh b/git-merge.sh\nindex 1c123a3..928b99d 100755\n--- a/git-merge.sh\n+++ b/git-merge.sh\n@@ -278,7 +278,7 @@ case \"$use_strategies\" in\n '')\n \tcase \"$#\" in\n \t1)\n-\t\tvar=\"`git config --get pull.twohead`\"\n+\t\tvar=\"$(git config --get pull.twohead)\"\n \t\tif test -n \"$var\"\n \t\tthen\n \t\t\tuse_strategies=\"$var\"\n@@ -286,7 +286,7 @@ case \"$use_strategies\" in\n \t\t\tuse_strategies=\"$default_twohead_strategies\"\n \t\tfi ;;\n \t*)\n-\t\tvar=\"`git config --get pull.octopus`\"\n+\t\tvar=\"$(git config --get pull.octopus)\"\n \t\tif test -n \"$var\"\n \t\tthen\n \t\t\tuse_strategies=\"$var\"\n@@ -455,10 +455,11 @@ do\n \n \tif test \"$exit\" -eq 1\n \tthen\n-\t    cnt=`{\n+\t    cnt=$({\n \t\tgit diff-files --name-only\n \t\tgit ls-files --unmerged\n-\t    } | wc -l`\n+\t\t} | wc -l\n+\t    )\n \t    if test $best_cnt -le 0 -o $cnt -le $best_cnt\n \t    then\n \t\tbest_strategy=$strategy\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex cbbb707..11c97d8 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -142,7 +142,7 @@ remove_backup () {\n merge_file () {\n     path=\"$1\"\n \n-    f=`git ls-files -u -- \"$path\"`\n+    f=$(git ls-files -u -- \"$path\")\n     if test -z \"$f\" ; then\n \tif test ! -f \"$path\" ; then\n \t    echo \"$path: file not found\"\n@@ -161,9 +161,9 @@ merge_file () {\n     mv -- \"$path\" \"$BACKUP\"\n     cp -- \"$BACKUP\" \"$path\"\n \n-    base_mode=`git ls-files -u -- \"$path\" | awk '{if ($3==1) print $1;}'`\n-    local_mode=`git ls-files -u -- \"$path\" | awk '{if ($3==2) print $1;}'`\n-    remote_mode=`git ls-files -u -- \"$path\" | awk '{if ($3==3) print $1;}'`\n+    base_mode=$(git ls-files -u -- \"$path\" | awk '{if ($3==1) print $1;}')\n+    local_mode=$(git ls-files -u -- \"$path\" | awk '{if ($3==2) print $1;}')\n+    remote_mode=$(git ls-files -u -- \"$path\" | awk '{if ($3==3) print $1;}')\n \n     base_present   && git cat-file blob \":1:$prefix$path\" >\"$BASE\" 2>/dev/null\n     local_present  && git cat-file blob \":2:$prefix$path\" >\"$LOCAL\" 2>/dev/null\n@@ -287,7 +287,7 @@ do\n \t-t|--tool*)\n \t    case \"$#,$1\" in\n \t\t*,*=*)\n-\t\t    merge_tool=`expr \"z$1\" : 'z-[^=]*=\\(.*\\)'`\n+\t\t    merge_tool=$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)')\n \t\t    ;;\n \t\t1,*)\n \t\t    usage ;;\n@@ -320,7 +320,7 @@ valid_tool() {\n }\n \n init_merge_tool_path() {\n-\tmerge_tool_path=`git config mergetool.$1.path`\n+\tmerge_tool_path=$(git config mergetool.$1.path)\n \tif test -z \"$merge_tool_path\" ; then\n \t\tcase \"$1\" in\n \t\t\temerge)\n@@ -335,7 +335,7 @@ init_merge_tool_path() {\n \n \n if test -z \"$merge_tool\"; then\n-    merge_tool=`git config merge.tool`\n+    merge_tool=$(git config merge.tool)\n     if test -n \"$merge_tool\" && ! valid_tool \"$merge_tool\"; then\n \t    echo >&2 \"git config option merge.tool set to unknown tool: $merge_tool\"\n \t    echo >&2 \"Resetting to default...\"\n@@ -388,7 +388,7 @@ fi\n \n \n if test $# -eq 0 ; then\n-\tfiles=`git ls-files -u | sed -e 's/^[^\t]*\t//' | sort -u`\n+\tfiles=$(git ls-files -u | sed -e 's/^[^\t]*\t//' | sort -u)\n \tif test -z \"$files\" ; then\n \t\techo \"No files need merging\"\n \t\texit 0\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 695a409..0611213 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -231,7 +231,7 @@ get_remote_refs_for_fetch () {\n \n resolve_alternates () {\n \t# original URL (xxx.git)\n-\ttop_=`expr \"z$1\" : 'z\\([^:]*:/*[^/]*\\)/'`\n+\ttop_=$(expr \"z$1\" : 'z\\([^:]*:/*[^/]*\\)/')\n \twhile read path\n \tdo\n \t\tcase \"$path\" in\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 46da0f4..4a2b3b6 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -46,7 +46,7 @@ do\n \t-s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)\n \t\tcase \"$#,$1\" in\n \t\t*,*=*)\n-\t\t\tstrategy=`expr \"z$1\" : 'z-[^=]*=\\(.*\\)'` ;;\n+\t\t\tstrategy=$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)') ;;\n \t\t1,*)\n \t\t\tusage ;;\n \t\t*)\ndiff --git a/git-repack.sh b/git-repack.sh\nindex e18eb3f..df3b795 100755\n--- a/git-repack.sh\n+++ b/git-repack.sh\n@@ -46,8 +46,8 @@ done\n # Later we will default repack.UseDeltaBaseOffset to true\n default_dbo=false\n \n-case \"`git config --bool repack.usedeltabaseoffset ||\n-       echo $default_dbo`\" in\n+case \"$(git config --bool repack.usedeltabaseoffset ||\n+       echo $default_dbo)\" in\n true)\n \textra=\"$extra --delta-base-offset\" ;;\n esac\n@@ -64,8 +64,8 @@ case \",$all_into_one,\" in\n \t;;\n ,t,)\n \tif [ -d \"$PACKDIR\" ]; then\n-\t\tfor e in `cd \"$PACKDIR\" && find . -type f -name '*.pack' \\\n-\t\t\t| sed -e 's/^\\.\\///' -e 's/\\.pack$//'`\n+\t\tfor e in $(cd \"$PACKDIR\" && find . -type f -name '*.pack' \\\n+\t\t\t| sed -e 's/^\\.\\///' -e 's/\\.pack$//' )\n \t\tdo\n \t\t\tif [ -e \"$PACKDIR/$e.keep\" ]; then\n \t\t\t\t: keep\ndiff --git a/git-request-pull.sh b/git-request-pull.sh\nindex 068f5e0..7d74137 100755\n--- a/git-request-pull.sh\n+++ b/git-request-pull.sh\n@@ -19,10 +19,10 @@ head=${3-HEAD}\n [ \"$base\" ] || usage\n [ \"$url\" ] || usage\n \n-baserev=`git rev-parse --verify \"$base\"^0` &&\n-headrev=`git rev-parse --verify \"$head\"^0` || exit\n+baserev=$(git rev-parse --verify \"$base\"^0) &&\n+headrev=$(git rev-parse --verify \"$head\"^0) || exit\n \n-merge_base=`git merge-base $baserev $headrev` ||\n+merge_base=$(git merge-base $baserev $headrev) ||\n die \"fatal: No commits in common between $base and $head\"\n \n url=$(get_remote_url \"$url\")\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex a6aaf40..18d15c2 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -28,7 +28,7 @@ say()\n # NEEDSWORK: identical function exists in get_repo_base in clone.sh\n get_repo_base() {\n \t(\n-\t\tcd \"`/bin/pwd`\" &&\n+\t\tcd \"$(/bin/pwd)\" &&\n \t\tcd \"$1\" || cd \"$1.git\" &&\n \t\t{\n \t\t\tcd .git\ndiff --git a/test-sha1.sh b/test-sha1.sh\nindex bf526c8..7243f1e 100755\n--- a/test-sha1.sh\n+++ b/test-sha1.sh\n@@ -6,13 +6,13 @@ dd if=/dev/zero bs=1048576 count=100 2>/dev/null |\n while read expect cnt pfx\n do\n \tcase \"$expect\" in '#'*) continue ;; esac\n-\tactual=`\n+\tactual=$(\n \t\t{\n \t\t\ttest -z \"$pfx\" || echo \"$pfx\"\n \t\t\tdd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |\n \t\t\ttr '\\000' 'g'\n \t\t} | ./test-sha1 $cnt\n-\t`\n+\t)\n \tif test \"$expect\" = \"$actual\"\n \tthen\n \t\techo \"OK: $expect $cnt $pfx\"\n@@ -51,14 +51,14 @@ exit\n \n while read cnt pfx\n do\n-\tactual=`\n+\tactual=$(\n \t\t{\n \t\t\ttest -z \"$pfx\" || echo \"$pfx\"\n \t\t\tdd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |\n \t\t\ttr '\\000' 'g'\n \t\t} | sha1sum |\n \t\tsed -e 's/ .*//'\n-\t`\n+\t)\n \techo \"$actual $cnt $pfx\"\n done <<EOF\n 0\n-- \n1.5.4-rc5.GIT-dirty\n\n\n-- \nWelcome to FOSS revolution: we fix and modify until it shines\n"}]}