On 9/12/22 10:33, enh wrote:
> here's BSD sed on macOS:
>
> *~$ *echo one | /usr/bin/sed N
>
> *~$ *echo -e 'one\none\none' | /usr/bin/sed 'N;ax'
>
> sed: 1: "N;ax": command a expects \ followed by text
>
> *~$ *
Yeah, being able to have the payload of "a" or "i" on the same line is a gnu
exte
here's BSD sed on macOS:
*~$ *echo one | /usr/bin/sed N
*~$ *echo -e 'one\none\none' | /usr/bin/sed 'N;ax'
sed: 1: "N;ax": command a expects \ followed by text
*~$ *
On Mon, Sep 12, 2022 at 6:23 AM Rob Landley wrote:
> Posix says the N command does NOT trigger the default print at EOF:
>
> h
Posix says the N command does NOT trigger the default print at EOF:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
[2addr]N
Append the next line of input, less its terminating , to the pattern
space, using an embedded to separate the appended material from the
origina
On 11/11/19 12:13, Rob Landley wrote:
On 11/10/19 6:56 PM, scsijon wrote:
I know it's not exactly a toybox problem, but can someone please sort this out
for me.
sed ':a;N;$!ba;s|>\s*<|><|g'
Could you please be a little more vague?
I could have except I considered either you or one of those
On 11/10/19 6:56 PM, scsijon wrote:
> I know it's not exactly a toybox problem, but can someone please sort this out
> for me.
>
> sed ':a;N;$!ba;s|>\s*<|><|g'
Could you please be a little more vague?
:a is a jump label
N means read the next line of input and append it to this one.
$! means m
I know it's not exactly a toybox problem, but can someone please sort
this out for me.
sed ':a;N;$!ba;s|>\s*<|><|g'
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net
for me this just hangs with TEST_HOST=1 (maybe i'm not patient enough,
but this is on a current Xeon!) and spews "sed: short write: Broken
pipe" if i'm testing the toybox version.
(as usual this is on recent-ish Debian.)
___
Toybox mailing list
Toybox@li
thanks. i was ooo so i didn't get chance to check whether ';' would
"just work"...
On Sat, Dec 15, 2018 at 6:26 PM Rob Landley wrote:
>
> On 12/11/18 4:09 PM, enh via Toybox wrote:
> > what's the right way to express an argument like sed's -iSUFFIX that takes
> > an
> > _optional_ string argum
On 12/11/18 4:09 PM, enh via Toybox wrote:
> what's the right way to express an argument like sed's -iSUFFIX that takes an
> _optional_ string argument? right now i'm struggling to think of a similar
> option to copy & paste from...
https://github.com/landley/toybox/commit/eadbf601a0c9
Rob
__
name filename" to work properly. And yes, I cared about both.
> There's a
> _reason_ it's not trying to use the libc optargs plumbing...
>
> I take it you have a script using the extension?
yeah, there's a bunch of `-i.bak`. t
On 12/11/18 5:34 PM, enh wrote:
> Ah, I didn't actually check the code --- I saw that the docs mentioned --color
> but they strongly imply that ; is *only* for long options. (Though what does
> that mean for -i versus --in-place? Maybe I should just try it and see what
> happens!)
I very vaguely r
Ah, I didn't actually check the code --- I saw that the docs mentioned
--color but they strongly imply that ; is *only* for long options. (Though
what does that mean for -i versus --in-place? Maybe I should just try it
and see what happens!)
On Tue, Dec 11, 2018, 15:24 Rob Landley On 12/11/18 4:0
On 12/11/18 4:09 PM, enh via Toybox wrote:
> what's the right way to express an argument like sed's -iSUFFIX that takes an
> _optional_ string argument? right now i'm struggling to think of a similar
> option to copy & paste from...
I'm not quite sure what you mean, but I implemented ; in lib/args
what's the right way to express an argument like sed's -iSUFFIX that takes
an _optional_ string argument? right now i'm struggling to think of a
similar option to copy & paste from...
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.n
On 09/30/2016 05:02 AM, ed38220 wrote:
> Hi!
>
> Samsung Galaxy S4 Mini Plus I9195I (CM 13 unofficial)
> toybox version : 0.7.0-892c602b10e7-android
>
> |# ls -l|
> |-rw-rw 1 u0_a201 u0_a201 4 2016-09-30 11:35 bb_test.txt|
> |-rw-rw 1 u0_a201 u0_a201 4 2016-09-30 11:35 tb_test.txt|
>
> |
On 03/26/2016 01:36 AM, Andy Chu wrote:
>> The problem to solve here is that Debian is currently broken when using
>> toybox. That's a real problem that needs to be fixed, but there's more
>> than one way to fix it. Debian introduced this bug within the past few
>> years and maybe we can convince
> The problem to solve here is that Debian is currently broken when using
> toybox. That's a real problem that needs to be fixed, but there's more
> than one way to fix it. Debian introduced this bug within the past few
> years and maybe we can convince them to fix it on their end, that's one
> pos
oesn't matter. If some script
out there uses it, we'll notice when we get the bug report and decide then.)
That said, have you read the toybox sed --help? I tried REALLY HARD to
cover everything thoroughly and concisely.
> Though I am wondering about the general toybox philosophy of
&g
>> 2) It does indeed seem undocumented -- I can't find any mention of
>> this (unintuitive) behavior in the GNU sed manual or FAQ:
>
> The _fun_ part is that this is doubly nonstandard, because the logic
> I've used so far is if the line of input didn't have a newline, we
> don't add one _until_ we
On Wed, Mar 23, 2016 at 1:30 PM, Andy Chu wrote:
>> No idea whether that is a valid complaint. coreutils accepts it and
>> treats it as "add a newline (but only if needed) and then do nothing".
>>
>> Debian's update-ca-certificates script uses that to conditionally add a
>> newline after a file wh
> No idea whether that is a valid complaint. coreutils accepts it and
> treats it as "add a newline (but only if needed) and then do nothing".
>
> Debian's update-ca-certificates script uses that to conditionally add a
> newline after a file which may or may not end with a newline:
> http://anonscm
On 03/23/2016 03:45 AM, Patrick Ohly wrote:
> Hello!
>
> I mentioned on IRC recently that sed -e '$a\' /dev/null segfaults. It
> was pointed out that commit 96a5ed118ce8ad fixes the segfault. I've now
> tried that fix and it indeed fixes the segfault.
>
> However, the sed invocation above still
Hello!
I mentioned on IRC recently that sed -e '$a\' /dev/null segfaults. It
was pointed out that commit 96a5ed118ce8ad fixes the segfault. I've now
tried that fix and it indeed fixes the segfault.
However, the sed invocation above still does not work because Toybox
complains about the missing te
0
> Subject: Re: toybox sed broken in all AOSP Marshmallow builds
> To: chris.rens...@live.com
> CC: toybox@lists.landley.net
>
> if you search the archives (assuming they're working today) for
> "toybox sed broken in Android Marshmallow (6.0) for LP32", you can see
&
if you search the archives (assuming they're working today) for
"toybox sed broken in Android Marshmallow (6.0) for LP32", you can see
the bionic patch that fixed this.
this has no impact on security, so it won't be backported.
On Wed, Jan 20, 2016 at 10:32 AM, Chris Renshaw
Hi guys, I just wanted to give you the heads up on sed being broken on my Nexus
5 and Nexus 7 2013 running the current Marshmallow 6.0.1 (MMB29S and MMB29O,
respectively).
Here is some example output:root@flo:/ # echo "blah" | sed "s/blah/test/";
testblah
root@flo:/ # echo "blah" | busybox sed "s
So, on irc you reported a bug, and I tried to reproduce it:
Build root-filesystem-i686, chroot into it with toolchain attached. So
that's something like:
tar xvzf root-filesystem-i686.tar.gz
tar xvzf native-compiler-i686.tar.gz
mv native-compiler-i686 root-filesystem-i686/usr/overlay
chro
On 09/04/2015 12:45 PM, enh wrote:
> [since bug reports are as likely to come here as anywhere, FYI...]
>
> The toybox sed shipped in Android M doesn't work on LP32. (LP64 is
> unaffected by this.) We build toybox with _FILE_OFFSET_BITS=64 and
> there was a previously undisc
[since bug reports are as likely to come here as anywhere, FYI...]
The toybox sed shipped in Android M doesn't work on LP32. (LP64 is
unaffected by this.) We build toybox with _FILE_OFFSET_BITS=64 and
there was a previously undiscovered off_t lurking in . This
is fixed in AOSP master by
David Halls wrote:
> I'm trying to compile libiconv. It has this in its configure script:
>
> sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
> func_dirname ()\
> {\
> \case ${1} in\
> \ */*) func_dirname_result="${1%/*}${2}" ;;\
> \ * ) func_dirname_result="${3}" ;;\
> \es
} # Extended-shell func_dirname implementation
i.e. backslashes are left in, which bash barfs on.
The busybox sed stripped out the backslashes, and libiconv compiled fine.
Is Toybox sed only stripping out eol backslashes?
David
___
Toybox mailing list
T
Rob Landley wrote:
> On 01/08/2015 03:38 PM, Felix Janda wrote:
> > sed doesn't allow embedded newlines in the replacement for s///, e.g.
> >
> > s/walrus/wal\
> > rus/
>
> Indeed, that's the next sed bug I'm wrestling with right now.
>
> > It is not obvious to me how to fix this. There is some
On 01/08/2015 03:38 PM, Felix Janda wrote:
> sed doesn't allow embedded newlines in the replacement for s///, e.g.
>
> s/walrus/wal\
> rus/
Indeed, that's the next sed bug I'm wrestling with right now.
> It is not obvious to me how to fix this. There is some code for dealing
> with line continua
sed doesn't allow embedded newlines in the replacement for s///, e.g.
s/walrus/wal\
rus/
It is not obvious to me how to fix this. There is some code for dealing
with line continuations but I don't see how to use it.
Felix
___
Toybox mailing list
Toybox
Rob Landley wrote:
[..]
> I believe the toybox behavior is right?
>
> We can simplify the above test by removing the p; entries that don't add
> a line to the output:
>
> echo -ne '1\n2\n3\n4\n' | sed -n '1{N;N;d};2,3p;4p'
>
> Toybox just prints one 4, and gnu prints two of them. The differenc
On 12/03/14 01:28, Ashwini Sharma wrote:
> Hi Rob,
>
> While testing thru busybox sed tests, it failed at this test case.
>
> # first three lines are deleted; 4th line is matched and printed by
> "2,3" and by "4" ranges
> testing "sed with N skipping lines past ranges on next cmds" \
> "sed -n
Hi Rob,
While testing thru busybox sed tests, it failed at this test case.
# first three lines are deleted; 4th line is matched and printed by "2,3"
and by "4" ranges
testing "sed with N skipping lines past ranges on next cmds" \
"sed -n '1{N;N;d};1p;2,3p;3p;4p'" \
"4\n4\n" "" "1\n2\n3\n4\n
sed 0p # has a specific error message in ubuntu. Why?
"sed 1,0p" # is allowed, equivalent to sed 1p
# ^ so matching ranges always include first line.
echo -e "salad\nsalad\nsalad" | sed -n '/salad/,/salad/p'
# ^ starting trumps ending, so matching ranges don't require a gap.
echo -e '\tx' | sed
38 matches
Mail list logo