Code Monkey home page Code Monkey logo

Comments (11)

enh-google avatar enh-google commented on July 22, 2024 2

you might want to check out https://github.com/onetrueawk/awk for an awk you can use right now. that's what we're using on Android (both to build Android and on the device itself).

from toybox.

landley avatar landley commented on July 22, 2024 1

I'm currently focusing on getting the toybox shell finished, ala https://github.com/landley/toybox/commits/master/toys/pending/sh.c with behind the scenes stuff at https://landley.net/notes.html .

Right now I'm doing the can of worms that is the 7 types of argument expansion, and right at the moment trying to get $((echo hello) | cat) to parse as subshell $( ( ) ) rather than arithmetic $(( )). (Ok, parse_word() already gets it right, but it leaves the resulting span as a quoted string for expand_arg_nobrace() to re-parse, and I'm trying not to duplicate the retroactive reclassification logic which would require lookahead here, so I probably need to get parse_word() to reach back and insert a space between those first two parentheses when the parenthetical count goes negative because (( wasn't accounted as normal parentheses, and yes $(((x+y)/3)) is math not subshell ($x and $y are automatically resolved) so you can't tell it's subshell until parsing reaches the end of the span.

If somebody wants to write an awk the way Jarno Mäkipää is doing vi or Gavin Howard did bc, I'll happily stick it in pending. But as when I plan to write one... dunno? Cleaning up and promoting existing toys/pending/*.c entries is higher priority than starting new ones at the moment. Closing tabs before opening more.

Elliott's external awk sounds like a reasonable stopgap until then.

from toybox.

landley avatar landley commented on July 22, 2024 1

The toybox roadmap has awk because it's used in a lot of package build systems. Generally if you can build Linux From Scratch with this awk, it's probably good enough.

That said, toybox supports utf8 where possible, so if I was working on awk I'd support that. (I'm teaching toysh to understand unicode $IFS for example.)

I'm not personally familiar with the differences between nawk, mawk, and gawk.

from toybox.

cesss avatar cesss commented on July 22, 2024 1

@amakukha In my case, I'd need an awk that can process UTF-8 files with no issues (i.e: imagine you want to process a C/C++ source that has UTF-8 chars on it, which is supported by the C/C++ standards nowadays).

from toybox.

cb88 avatar cb88 commented on July 22, 2024

All of those are already on the roadmap! http://landley.net/toybox/roadmap.html

Also does your script use awk or gawk? If gawk makes I can imagine it would just be an alias for awk.

BTW, you'll get more responsive replys from the mailing list than here.

from toybox.

tpimh avatar tpimh commented on July 22, 2024

tr and stty are now in pending. Check if they have all the features that you need.

from toybox.

sebma avatar sebma commented on July 22, 2024

@cb88 I use cut, grep, and awk filters in a script that I run at recovery (where /usr is not mounted).

In the meantime, I use busybox.

Approximately what month will the awk toybox functionality be released in 2020 ?

from toybox.

cesss avatar cesss commented on July 22, 2024

Now that you talk about awk let me comment that "one true awk" doesn't support UTF-8, and that they don't plan to add support for it (I opened an issue for that, but their reply was that it was not in the roadmap and that it would imply a huge amount of work).

These days, with plenty of localized text files everywhere, I wouldn't consider an awk implementation ready for production use if it cannot process UTF-8 text.

from toybox.

amakukha avatar amakukha commented on July 22, 2024

By the way, if somebody was to implement awk for toybox, what would be the desired feature set? @landley , @amosbird , @sebma

These question arise:

  1. Do we want it to be a drop-in replacement for nawk (a.k.a. "one-true-awk")?
  2. Do we want it to use linear bytecode, like mawk? (Which is still six times faster than gawk for some simple workloads, e.g. counting word frequency.)
  3. Do we want to fully support Unicode on top of that? (Neither nawk nor mawk fully support it.)

I was thinking whether I could do "AWK for toybox" as my capstone university project. But I am afraid that if you want to keep it too simple, then it might look too easy for my project advisor and the judge panel…

P.S. If not AWK, feel free to give me a suggestion whether I can otherwise spend two months of my time by contributing something meaningful to toybox and making my professors happy at same time.

from toybox.

sebma avatar sebma commented on July 22, 2024

@amakukha I don't need Unicode support in Linux rescue.
I don't know what is linear bytecode.

from toybox.

enh-google avatar enh-google commented on July 22, 2024

stty, tr, and awk are all listed with their current state on https://landley.net/toybox/status.html with stty and tr being "partially implemented" and awk "not yet started".

from toybox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.