public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* Solaris sed
@ 2025-06-12  3:23 Brad Smith
  2025-06-12  3:42 ` Collin Funk
  2025-06-12  4:03 ` Junio C Hamano
  0 siblings, 2 replies; 16+ messages in thread
From: Brad Smith @ 2025-06-12  3:23 UTC (permalink / raw)
  To: git

Building on Solaris I noticed the following two issues with Solaris sed.

     GEN version-def.h
sed: Missing newline at end of file standard input.

     GEN config-list.h
sed: illegal option -- E
Usage:  sed [-n] script [file...]
         sed [-n] [-e script]...[-f script_file]...[file...]


https://github.com/git/git/commit/e1b81f54da80267edee2cb8fd0d0f75f03023019

The second issue being introduced fairly recently. Not sure what would be
appropriate fixes. Just pointing them out if someone has an suggestions for
fixes.


^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: Solaris sed
@ 2025-06-12 22:52 Ben Knoble
  0 siblings, 0 replies; 16+ messages in thread
From: Ben Knoble @ 2025-06-12 22:52 UTC (permalink / raw)
  To: paul; +Cc: git


> Le 12 juin 2025 à 09:42, Paul Smith <paul@mad-scientist.net> a écrit :
> 
> On Thu, 2025-06-12 at 01:50 -0400, Eric Sunshine wrote:
>> Had it used the simpler:
>>    echo "$foo"
>> this sort of problem (forgetting the "\n") would never have occurred.
> 
> Just be aware that echo is not well-standardized: many versions of echo
> accept extra options or treat certain chars specially.  So, printf
> (which IS well-standardized) is always safer unless you are 100% sure
> that the text on the echo command line is simple: cannot start with a
> "-", doesn't contain special chars like backslash, etc.
> 
> For portability I (personally) always prefer printf unless I know
> exactly what the text contains (like showing a static string).

For exactly this reason, I attempted to write echo(1) to the standards I could find freely available; POSIX mentioned 4, IIRC.

https://github.com/benknoble/echocho

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-06-13 20:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-12  3:23 Solaris sed Brad Smith
2025-06-12  3:42 ` Collin Funk
2025-06-12  3:49   ` Brad Smith
2025-06-12  4:16     ` Eli Schwartz
2025-06-12  4:25       ` Collin Funk
2025-06-12  4:26       ` Brad Smith
2025-06-12  4:03 ` Junio C Hamano
2025-06-12  4:13   ` Brad Smith
2025-06-12  4:19     ` Collin Funk
2025-06-13 20:13       ` Jean-Noël AVILA
2025-06-13 20:23         ` Eric Sunshine
2025-06-13 20:30         ` Collin Funk
2025-06-12  5:50   ` Eric Sunshine
2025-06-12 13:35     ` Paul Smith
2025-06-12 16:40       ` Eric Sunshine
  -- strict thread matches above, loose matches on Subject: below --
2025-06-12 22:52 Ben Knoble

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox