18/11/20, tenth day in a row

Awk, my god! rss feed

Yesterday I tried this automation that checked the contents of /css and created an html index from the data. I used unix commands, pipes, redirection, sed, and I managed to have something that worked from the command line, but for some reason (escapes maybe?) I could not make it run from a script. I went to bed to sleep on that. In the morning, I remembered that there was another amazing tool on my machine and that I should probably try it. awk is a truly interesting language especially for what I needed: an ls output is made of a number of fields and having to parse that with sed was painstakingly difficult while awk automatically recognized the fields and proposed easy syntax to manipulate them. In about half an hour I had my script, tested and packaged.

What did I do?

The script is here: index.sh. There are probably lots of ways to improve it. I'll investigate that another day. For now, it automatically creates the index for the 2018 css files.