Re: [PATCH] autodate.sh: Use printf instead of echo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 2017-01-17 @ 08:33:10 PM, Akira Yokosawa wrote:
> From bcd083c6be7cd9c69d1e05d19d732c32147bfd9a Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@xxxxxxxxx>
> Date: Tue, 17 Jan 2017 20:04:54 +0900
> Subject: [PATCH] autodate.sh: Use printf instead of echo
> 
> Using "echo" command to generate output containing "\" characters
> caused a build error depending on the variant of "sh".
> For portability, we should use "printf" via "env" command.
> 
> Fixes: 878bf8160a5c
> Reported-by: Trevor Woerner <twoerner@xxxxxxxxx>
Tested-by: Trevor Woerner <twoerner@xxxxxxxxx>
> Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
> ---
>  utilities/autodate.sh | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/utilities/autodate.sh b/utilities/autodate.sh
> index 6df8f99..a56bc70 100644
> --- a/utilities/autodate.sh
> +++ b/utilities/autodate.sh
> @@ -35,7 +35,7 @@ else
>  	gitstatus=`git status --porcelain | wc -l`
>  	if [ $gitstatus != "0" ]
>  	then
> -		modified=" (m)"
> +		modified="(m)"
>  	else
>  		modified=""
>  	fi
> @@ -44,5 +44,5 @@ month=`date --date="$date_str" +%B`
>  year=`date --date="$date_str" +%Y`
>  day=`date --date="$date_str" +%e`
>  
> -echo "\\date{$month $day, $year$modified}"
> -echo "\\\newcommand{\\\commityear}{$year}"
> +env printf "\\date{%s %s, %s %s}\n" $month $day $year $modified
> +env printf "\\\newcommand{\\\commityear}{%s}\n" $year
> -- 
> 2.7.4
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux