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