git-quiltimport /bin/sh-ism fix
PATCH 1/1 git-quiltimport /bin/sh-ism fix
Bryan Wu reported/usr/local/bin/git-quiltimport: 114: Syntax error: Missing '))'
Most bourne-ish shells I have here accept
x=$((echo x)|cat)
but all bourne-ish shells I have here accept
x=$( (echo x)|cat)
because $(( might mean arithmetic expansion.
--- git-quiltimport.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
git-quiltimport.sh +1 -1
@@ -115,7 +115,7 @@ for patch_name in $(cat "$QUILT_PATCHES/series" | grep -v '^#'); do if [ -z "$dry_run" ] ; then git-apply --index -C1 "$tmp_patch" && tree=$(git-write-tree) && - commit=$((echo "$SUBJECT"; echo; cat "$tmp_msg") | git-commit-tree $tree -p $commit) && + commit=$( (echo "$SUBJECT"; echo; cat "$tmp_msg") | git-commit-tree $tree -p $commit) && git-update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4 fi done
Signature · 1 line
1.5.1.rc3-dirty
Quoted 19 lines · Francis Daly
Bryan Wu reported
/usr/local/bin/git-quiltimport: 114: Syntax error: Missing '))'Most bourne-ish shells I have here accept
x=$((echo x)|cat)
but all bourne-ish shells I have here accept
x=$( (echo x)|cat)
because $(( might mean arithmetic expansion.Signed-off-by Francis Daly <[email protected]>--- git-quiltimport.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)git-quiltimport.sh +0
-0
git-quiltimport.sh for patch_name in $(cat "$QUILT_PATCHES/series" | grep -v '^#'); do · line 121
Quoted 8 lines
git-quiltimport.sh +1
-1@@ -115,7 +115,7 @@ for patch_name in $(cat "$QUILT_PATCHES/series" | grep -v '^#'); do if [ -z "$dry_run" ] ; then git-apply --index -C1 "$tmp_patch" && tree=$(git-write-tree) && - commit=$((echo "$SUBJECT"; echo; cat "$tmp_msg") | git-commit-tree $tree -p $commit) && + commit=$( (echo "$SUBJECT"; echo; cat "$tmp_msg") | git-commit-tree $tree -p $commit) && git-update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4 fi done
Cool. Thanks a lot.
-Bryan
Quoted 8 lines · Francis Daly
Bryan Wu reported
/usr/local/bin/git-quiltimport: 114: Syntax error: Missing '))'Most bourne-ish shells I have here accept
x=$((echo x)|cat)
but all bourne-ish shells I have here accept
x=$( (echo x)|cat)
because $(( might mean arithmetic expansion.
Well spotted, thanks.
Sheesh, this is even warned in POSIX sh manpage.