Automatic log listing

For a first post I thought it would be neat to talk a little bit about the semi-automatic listing of new log entries.

As I am an idiot when it comes to automating things, I have no idea how I should do this properly. But as a posix shell novice, I thought it would be a neat challenge to write a little script that goes through the directory where I keep these files.

Also, its seven lines total.

First thing it does it print the title of the gemlog list.

Then it goes through the gemlog directory, listing out each file using find and adding the necessary characters in front of them to make gemini interpret them as URLs.

Then it reads out the first line of each file, removes the hash symbol and adds it after the fine name and path with a little dash in order to make the title show on the list of gemlog entries.

All I have to do now is run the script and redirect its output to the log.gmi file.

All in all, I am sure it could be done a lot more efficiently, but I am quite happy with how it turned out.

Back