[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/multiarch 3006a3b 3/5: Prefer 'printf' to 'print
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/multiarch 3006a3b 3/5: Prefer 'printf' to 'print' in shell scripts |
Date: |
Wed, 17 Apr 2019 22:46:20 -0400 (EDT) |
branch: odd/multiarch
commit 3006a3bd96626488988932c1b5069962f5aa2b42
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Prefer 'printf' to 'print' in shell scripts
See:
https://lists.nongnu.org/archive/html/lmi/2019-04/msg00013.html
---
check_git_setup.sh | 2 +-
install_msw.sh | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/check_git_setup.sh b/check_git_setup.sh
index b763f7a..08117fd 100755
--- a/check_git_setup.sh
+++ b/check_git_setup.sh
@@ -24,7 +24,7 @@
# Navigate to the directory where this script resides, and make sure
# it's a git "toplevel" directory.
-cd $(dirname $(readlink -f "$0")) || print "Cannot cd"
+cd $(dirname $(readlink -f "$0")) || printf 'Cannot cd\n'
toplevel=$(git rev-parse --show-toplevel)
printf '"%s" is current directory\n' "$PWD"
printf '"%s" is git toplevel directory\n' "$toplevel"
diff --git a/install_msw.sh b/install_msw.sh
index 9b74c1c..0b906a3 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -126,11 +126,11 @@ java -version
if [ "/opt/lmi/src/lmi" = "$PWD" ]
then
inhibit_git_clone=1
- print "Running in lmi srcdir, so inhibiting git clone."
+ printf 'Running in lmi srcdir, so inhibiting git clone.\n'
fi
mkdir --parents /opt/lmi/src
-cd /opt/lmi/src || print "Cannot cd"
+cd /opt/lmi/src || printf 'Cannot cd\n'
# Set 'inhibit_git_clone=1' to test uncommitted changes.
if [ "$inhibit_git_clone" != 1 ]
@@ -151,7 +151,7 @@ then
|| git clone https://github.com/vadz/lmi.git
fi
-cd /opt/lmi/src/lmi || print "Cannot cd"
+cd /opt/lmi/src/lmi || printf 'Cannot cd\n'
./check_git_setup.sh
- [lmi-commits] [lmi] odd/multiarch updated (cdfac5b -> 0f63381), Greg Chicares, 2019/04/17
- [lmi-commits] [lmi] odd/multiarch 44ffabf 2/5: Complain, and do nothing else, if host type is unrecognized, Greg Chicares, 2019/04/17
- [lmi-commits] [lmi] odd/multiarch 3006a3b 3/5: Prefer 'printf' to 'print' in shell scripts,
Greg Chicares <=
- [lmi-commits] [lmi] odd/multiarch 0f63381 5/5: Hesitate to use 'command -v', Greg Chicares, 2019/04/17
- [lmi-commits] [lmi] odd/multiarch 392a189 1/5: Import several changes from trunk, Greg Chicares, 2019/04/17
- [lmi-commits] [lmi] odd/multiarch f8adc38 4/5: Simplify documentation of alternatives, Greg Chicares, 2019/04/17