Settings

Theme

yy092: busybox omits csplit

1 points by textmode a year ago · 3 comments · 1 min read


NB. Try using busybox awk instead of yy092

usage:

sed -n '/pattern/='|yy092|sed -nf/dev/stdin file

       /*
         context split using sed 
       */
   
    int fileno (FILE *);
    int x,y,z;
   %option nounput noinput noyywrap 
   %%
   ^[0-9]+$ {
    if(x){fprintf(stdout,"%d,%dwxx%02d\n",z,atoi(yytext)-1,y);x=0;y++;}
    if(!x){z=atoi(yytext);x++;}
    }
   .|\n
   %%
    int main(){yylex();exit(0);}
textmodeOP a year ago

correction:

sed -n '/pattern/=' file|yy092|sed -nf/dev/stdin file

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection