Shell Scripting

7 articles

Shell Traps and Posix Signals

 · 7 min
Shell traps catch POSIX signals (and more) to allow asynchronous inter-process communication to inform any process or particular thread of various events and do some work. But do you know about all the different signals and ways to use the trap command?
Read More
Recently, I stumbled upon an OCR tool for Linux. However, I didn’t like the idea of needing a GUI app, so I wrote a shell script connecting the right CLI tools instead. This article dissects “grab-text”, a simple POSIX-compatible shell script I wrote for grabbing text from your screen.
Read More

Shell Redirection 101

 · 9 min
Shell redirection can be confusing. I’ve always wondered what 2>&1 means and why it’s needed, but as many others, I just copy/pasted things from the internet into my terminal and hoped for the best. What could possibly go wrong?
Read More
Around 6 years ago, I wrote about using Java for shell scripts. It was a hacky and fragile way to convert some Java code into a shebanged file containing the content of a Jar file. However, Java evolved quite a bit since that article, so it’s time to look at it again.
Read More
The first version of my Calibre export tool got released today!
Read More
Shell scripting is a powerful tool available on all platforms, even Windows, thanks to WSL. But it can be easy to make mistakes. Here are some tips to improve our scripts and avoid many problems.
Read More