# Re: Solaris sed

1 messages from 2025-06-12 to 2025-06-12. Participants: Ben Knoble.
Thread: https://gitlist.dev/t/63638

## Ben Knoble, 2025-06-12 22:52

Subject: Re: Solaris sed
Message-ID: <CAA388EA-9C6A-439F-BF67-ED40DE97F532@gmail.com>
URL: https://gitlist.dev/e/CAA388EA-9C6A-439F-BF67-ED40DE97F532%40gmail.com

```
﻿
> 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
```
