git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Replace "echo -n" with printf in shell scripts.

From
Junio C Hamano <junkio@cox.net>
Date
Jan 18, 2007, 00:13 UTC
Message-ID
<7v7ivlp4y0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<45AEB932.3060509@fs.ei.tum.de>
Simon 'corecode' Schubert <corecode@fs.ei.tum.de> writes:
Show 8 quoted lines
> Junio C Hamano wrote:
>>>> We have done this already so it might be too late to raise this
>>>> question, but does everybody have printf?
>> The problematic are less common ones, ranging from (not so less
>> common) OSX, Solaris to (much less common) AIX that some people
>> seem to run git on (or at least compile git for).
>
> printf(1) is part of POSIX/SUSv3, so systems *should* have it.

A lot of the portability problem we suffered were about the things that systems *should* have it.

Unfortunately a standard does not matter a whit on its own when dealing with the real world. That's why I muttered the above even though I knew POSIX says you should have one.

We use POSIX as one of the yardsticks to see what we should stay away (i.e. "that is not even in POSIX so let's not use it for now"), and also how far we are willing to bend over (i.e. "any reasonable system should have it; besides, it is in POSIX. Let's use it -- it is so convenient -- and insane platforms can screw themselves").

The key point in the latter is that "besides" is not "because".
Previous: Simon 'corecode' Schubert
Message 11 of 11 in “Replace "echo -n" with printf in shell scripts.”
  1. Replace "echo -n" with printf in shell scripts.Jason Riedy, Jan 16, 2007
  2. Junio C HamanoJan 16, 2007
  3. Jason RiedyJan 16, 2007
  4. Eric BlakeJan 16, 2007
  5. Horst H. von BrandJan 17, 2007
  6. Junio C HamanoJan 17, 2007
  7. Brian GernhardtJan 17, 2007
  8. Julian PhillipsJan 17, 2007
  9. Horst H. von BrandJan 17, 2007
  10. Simon 'corecode' SchubertJan 18, 2007
  11. Junio C HamanoJan 18, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.