3 ms·
> The awk program is not very readable What do you find hard to read about it? If you know what make does, I think it is fairly easy to read, even for those wh
by Someone 3y ago
> The awk program is not very readable
What do you find hard to read about it? If you know what make does, I think it is fairly easy to read, even for those who don’t know awk at all, but do know the Unix shell (to recognize ‘ls -t’) and C (both of which, probably the audience for this book knew, given that the book is from 1988)
> I think for something like this I'd prefer a bash script
But would it be easier to read? I doubt see why it would.
- mauvehaus 3y agoBash also would have been an unlikely choice for a book published in 1988, considering it wasn't released until 1989 (Per Wikipedia).
- Brian_K_White 3y agoIt would have been ksh, which was the bash of the day, as in, the more featureful sh-compatible sh-superset. But a bash or ksh script would have been less readable than awk. bash (or ksh88 or ksh93) is powrful and useful but not readable if you're actually using the powerful useful features. In bash, a lot of functionality comes in the form of brace expansions and word splitting, basically abusing the command parser to get results there is no actual function for. In awk and any other more normal programming language, those same features come in the form of an explicit function to do that thing.
- fuzztester 3y ago>In bash, a lot of functionality comes in the form of brace expansions and word splitting, basically abusing the command parser to get results there is no actual function for. In awk and any other more normal programming language, those same features come in the form of an explicit function to do that thing. Right. That's one of the reasons why the man page for bash is so long. IIRC, going way back, even the page for plain sh was long, for the same reason.
- falcor84 3y agoIndeed. But at least it acknowledges it, with the iconic "It's too big and too slow."
- fuzztester 3y agoInteresting, didn't know. Been a while since I read the page.
- Someone 3y ago> It would have been ksh No, it wouldn’t have been ksh or any other shell, nor C or Perl, nor anything else but awk, in a book titled “The AWK Programming Language”.
- Brian_K_White 3y agoSomeone didn't read the thread (or lost the plot), but that didn't stop them from making a non-sensical remark about it.