>From 43bf4cc57125d756ccd14b629692c4ecdb5c36dc Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiyks@xxxxxxxxx> Date: Mon, 23 Dec 2019 20:52:46 +0900 Subject: [PATCH v2] utilities/autodate: Restore compatibility with bash Also improve uses of single quotes (without escaping) and double quotes (with escaping) in the script. Fixes: 650f763c31e8 ("utilities/autodate: Mark released versions") Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> --- Changes in v2: o Modified title o Tested with both "dash" and "bash" as /bin/sh Thanks, Akira -- utilities/autodate.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/utilities/autodate.sh b/utilities/autodate.sh index 4e448976..644123a3 100644 --- a/utilities/autodate.sh +++ b/utilities/autodate.sh @@ -47,9 +47,8 @@ year=`date --date="$date_str" +%Y` day=`date --date="$date_str" +%e` if test -n "$release" then - release="\\\\\\\\ Release $release" + release=`env printf '%s %s' '\\\\' "Release $release"` fi -# env printf "\\date{%s %s, %s %s %s}\n" $month $day $year $modified $release -echo "\\date{$month $day, $year $modified $release}" -env printf "\\\newcommand{\\\commityear}{%s}\n" $year +env printf '\\date{%s %s, %s %s %s}\n' $month $day $year $modified "$release" +env printf '\\newcommand{\\commityear}{%s}\n' $year -- 2.17.1