Hacker News new | past | comments | ask | show | jobs | submit login

> 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.




Bash also would have been an unlikely choice for a book published in 1988, considering it wasn't released until 1989 (Per Wikipedia).


It 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.


>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.


Indeed. But at least it acknowledges it, with the iconic "It's too big and too slow."


Interesting, didn't know. Been a while since I read the page.


> 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”.


Someone didn't read the thread (or lost the plot), but that didn't stop them from making a non-sensical remark about it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: