[Toybox] macOS sed

enh enh at google.com
Fri Nov 30 22:58:32 PST 2018


On Thu, Nov 29, 2018 at 6:31 PM Rob Landley <rob at landley.net> wrote:
>
> On 11/29/18 5:37 PM, enh wrote:
> >> Anyway, I'm happy to give a clearer error. _How_? (What does "uname -o" say on a
> >> mac?)
> >
> > "illegal option" :-)
> >
> > just plain `uname` gets me "Darwin".
> >
> > (given that `toybox uname -o` behaves differently than coreutils and
> > busybox ["Linux" versus "GNU/Linux"], and isn't even documented in
> > toybox, you might want to steer clear of that anyway.)
>
> Sigh. Serves me right for looking at "man uname" and thinking the result meant
> anything...
>
> But [ "$(uname)" == "Darwin" ] I can work with.
>
> >> At the very leas I can make $SED default to "gsed" when [[ "$(uname -o")
> >> =~ Mac ]]  or some such, then at least the error is gsed missing. But that
> >> assumes I'm detecting MacOS...
> >
> > the reason why i haven't sent you a patch is that there's a bunch of
> > other scripts that need similar treatment... should i factor it out
> > into scripts/findsed.sh and source that from the affected scripts?
>
> What other scripts need this treatment?

i assume you mean which scripts *absolutely* need it (or you'd have
just run `grep -rw sed`)... iirc, it was test.sh and single.sh.

but presumably if we had a findsed.sh we'd just call it everywhere and
switch everything over to $SED?

> Rob



More information about the Toybox mailing list