[augeas-devel] augeas: master - Use printf instead of 'echo -e' in tests

David Lutterkort lutter at fedoraproject.org
Wed Feb 11 21:43:13 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=4a8e12203a8426c77d2b1642b4719a19493b9760
Commit:        4a8e12203a8426c77d2b1642b4719a19493b9760
Parent:        dd25c31554555d67cb21ed46253af4f8ca533e0e
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Fri Feb 6 21:43:12 2009 -0800
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Fri Feb 6 21:43:12 2009 -0800

Use printf instead of 'echo -e' in tests

Printf is more portable
---
 tests/test-preserve.sh   |    4 ++--
 tests/test-save-empty.sh |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/test-preserve.sh b/tests/test-preserve.sh
index 392e05b..9bca698 100755
--- a/tests/test-preserve.sh
+++ b/tests/test-preserve.sh
@@ -19,7 +19,7 @@ ls -il $1 | cut -d ' ' -f 1
 AUGTOOL="augtool --nostdinc -r $root -I $abs_top_srcdir/lenses"
 init_dirs
 
-echo -e '127.0.0.1\tlocalhost' > $hosts
+printf '127.0.0.1\tlocalhost\n' > $hosts
 
 chmod 0600 $hosts
 group=$(groups | tr ' ' '\n' | tail -n 1)
@@ -86,7 +86,7 @@ if [ $? != 0 ] ; then
 fi
 
 # Check that we preserve a backup file on request
-echo -e '127.0.0.1\tlocalhost' > $hosts
+printf '127.0.0.1\tlocalhost\n' > $hosts
 exp_inode=$(stat_inode $hosts)
 
 $AUGTOOL -b > /dev/null <<EOF
diff --git a/tests/test-save-empty.sh b/tests/test-save-empty.sh
index 53212ff..d3ee87c 100755
--- a/tests/test-save-empty.sh
+++ b/tests/test-save-empty.sh
@@ -47,7 +47,7 @@ if [ ! -f $HOSTS ] ; then
     exit 1
 fi
 
-echo -e '127.0.0.1\tlocalhost' > $HOSTS.expected
+printf '127.0.0.1\tlocalhost\n' > $HOSTS.expected
 
 if ! cmp $HOSTS $HOSTS.expected > /dev/null 2>&1 ; then
     echo "Contents of $HOSTS are incorrect"




More information about the augeas-devel mailing list