shell code fixes Escape sequences are not handled by every echo(1), e.g. not on FreeBSD. '?' is a glob character and must be quoted. '!' is not a shell meta character. ok tracey stsp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
diff --git a/regress/cmdline/checkout.sh b/regress/cmdline/checkout.sh
index 7e75429..14a2541 100755
--- a/regress/cmdline/checkout.sh
+++ b/regress/cmdline/checkout.sh
@@ -821,7 +821,7 @@ test_checkout_quiet() {
echo -n "Checked out refs/heads/master: " >> $testroot/stdout.expected
git_show_head $testroot/repo >> $testroot/stdout.expected
- echo "\nNow shut up and hack" >> $testroot/stdout.expected
+ printf "\nNow shut up and hack\n" >> $testroot/stdout.expected
got checkout -q $testroot/repo $testroot/wt > $testroot/stdout
ret="$?"
diff --git a/regress/cmdline/status.sh b/regress/cmdline/status.sh
index 47f3fb7..de94a6e 100755
--- a/regress/cmdline/status.sh
+++ b/regress/cmdline/status.sh
@@ -746,7 +746,7 @@ test_status_status_code() {
echo '! epsilon/zeta' > $testroot/stdout.expected
echo '? foo' >> $testroot/stdout.expected
- (cd $testroot/wt && got status -s \!? > $testroot/stdout)
+ (cd $testroot/wt && got status -s !\? > $testroot/stdout)
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
@@ -878,7 +878,7 @@ test_status_suppress() {
fi
echo 'M alpha' > $testroot/stdout.expected
- (cd $testroot/wt && got status -S D?A\! > $testroot/stdout)
+ (cd $testroot/wt && got status -S D\?A! > $testroot/stdout)
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
@@ -888,7 +888,7 @@ test_status_suppress() {
fi
echo 'D beta' > $testroot/stdout.expected
- (cd $testroot/wt && got status -S M?A\! > $testroot/stdout)
+ (cd $testroot/wt && got status -S M\?A! > $testroot/stdout)
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
@@ -909,7 +909,7 @@ test_status_suppress() {
fi
echo 'A new' > $testroot/stdout.expected
- (cd $testroot/wt && got status -S MD?\! > $testroot/stdout)
+ (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
@@ -921,7 +921,7 @@ test_status_suppress() {
(cd $testroot/wt && got stage new > $testroot/stdout)
echo ' A new' > $testroot/stdout.expected
- (cd $testroot/wt && got status -S MD?\! > $testroot/stdout)
+ (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
@@ -934,7 +934,7 @@ test_status_suppress() {
echo 'M alpha' > $testroot/stdout.expected
echo 'MA new' >> $testroot/stdout.expected
- (cd $testroot/wt && got status -S D?\! > $testroot/stdout)
+ (cd $testroot/wt && got status -S D\?! > $testroot/stdout)
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
@@ -944,7 +944,7 @@ test_status_suppress() {
fi
echo 'M alpha' > $testroot/stdout.expected
- (cd $testroot/wt && got status -S AD?\! > $testroot/stdout)
+ (cd $testroot/wt && got status -S AD\?! > $testroot/stdout)
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
@@ -956,7 +956,7 @@ test_status_suppress() {
rm $testroot/stdout.expected
touch $testroot/stdout.expected
- (cd $testroot/wt && got status -S MD?\! > $testroot/stdout)
+ (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then