On Fri, Jan 10, 2025 at 12:17 PM Rob Landley <r...@landley.net> wrote: > > On 1/10/25 09:19, enh wrote: > > On Thu, Jan 9, 2025 at 5:41 PM Rob Landley <r...@landley.net> wrote: > >> $ ./test abc '=~' a.c > >> $ ./test abc =~ a.c > >> > >> Commit 2407a5f51b58 added support for "=~". Is your shell somehow > >> expanding ~ maybe? (I thought that only happened when it was the first > >> character of its word?) > > > > interesting you should say that because... > > Shenanigans in mksh was the main thing left to look at. And I went > fairly thoroughly through this area implementing it myself. > > https://landley.net/notes-2020.html#02-01-2020 > > I don't remember if these are in sh.test or my sh-todo.txt but it's > stuff I cared about getting right, none expand in bash: > > echo ""~ > echo ~"landley" > echo ~landle\y > > Aha! And I'm getting one wrong. Quote removal still needs to happen for > ~"landley" it just happens _after_ tilde expansion fails... > > >>> 2|cheetah:/ # /system/bin/toybox test abc =~ a.c > >>> test: too many arguments > >> > >> Try "echo abc =~ a.c" maybe? > >> > >>> 2|cheetah:/ # test abc =~ a.c > >>> /system/bin/sh: test: =/: unexpected operator/operand > >>> 2|cheetah:/ # > >> > >> Ok, not using the shell builtin. Huh. > > > > ...and look at the error: it says "test: =/: " implying that, yes, =~ > > has been turned into =/ by mksh. > > Commit c914983e3aee
still broken in the same way. i've tried various kinds of extra escaping with no luck either... > Rob _______________________________________________ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net