[Toybox] [PATCH] A implemetation of the 'csplit' command

Oliver Webb aquahobbyist at proton.me
Mon Sep 11 21:56:50 PDT 2023


I have made a implementation of the 'csplit' command in about 160 lines of code.

The implementation is mostly POSIX compliment, but it is missing a few things 

It works as a Read-Eval-Print loop, where it prints to a file that changes based on context. So doing negative offsets would require it to print lines it doesn't accumulate yet.

The other main one is the fact it doesn't do "[LINE] {[NUMBER]}" cleanly yet.

It also includes the GNU extension "{*}" argument

The other breaks from POSIX are mostly insignificant, like the fact it doesn't check locale environment variables or uses "%lu" for file size instead of "%d". 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 96c08c5.patch
Type: text/x-patch
Size: 4734 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230912/c5cb88a8/attachment.bin>


More information about the Toybox mailing list