coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] tests: use printf, not echo in init.sh's warn_ function


From: Jim Meyering
Subject: Re: [PATCH] tests: use printf, not echo in init.sh's warn_ function
Date: Wed, 15 Jun 2011 22:15:35 +0200

James Youngman wrote:
> I'd doubt that there are gnulib tests for which this will really make
> a difference, but

There is none in coreutils, but there *are* tests there that set IFS.
Just none that use these relatively new functions in an affected scope.

> ( IFS=' '; printf '%s\n' "$*"; )
>
> is perhaps slightly more reproducible.

Good suggestion.  Setting IFS does seem prudent.
However, I'm inclined to use a subshell only if necessary:

warn_ ()
{
  case $IFS in
    ' '*)         printf '%s\n' "$*" 1>&$stderr_fileno_   ;;
    *) ( IFS=' '; printf '%s\n' "$*" 1>&$stderr_fileno_ ) ;;
  esac
}

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]