Tiny Experiment with Shell Scripting
I got interested in Tiny Experiments: How to Live Freely in a Goal-Obsessed World by Anne-Laure Le Cunff through John Rakestraw’s January book reviews. I read the book and decided to try a “tiny experiment.”
For a long time I’ve wanted to learning to program for personal use on my computer. I had taken some programming courses in the 1980s and loved it. I’ve forgotten all of it, because I never used anything but BASIC outside of class. In more recent years I’ve tried reading a couple of books on programming, but never got very far. It felt like failure. Maybe a “tiny experiment” was what I needed. The idea is to set a short period to do something consistently as an experiment to see if it really suits you. Motivation is shifted from accomplishment to curiosity. It is not a failue if the experiment doesn’t lead to more than the trial period. I feel a sense of freedom and fun in this shift in mental attitude.
For my first experiment I decided to study an old book on Perl programming for a half hour or more each day for 2 weeks. I did it and the result was knowing that I didn’t like the language at all. Perl seemed so odd to me. Amusing with words like “chomp” but not appealing.
I’m a bit familiar with Bash commands and it would be useful on my Linux system so it made sense to give Bash scripting a try. This time I followed another suggestion from the book which is that it is better to not do these things alone. I asked around for advice on what to use as a study source and got several ideas. I decided to do a combination of a written tutorial on Bourne shell scripting and a 7+ hour video course on Bash scripting.
At the end of two weeks I knew that I did not want to complete the Bourne shell tutorial. I also knew that Dave Eddy was giving a lot of information very rapidly in the video course. I kept up with him as he discussed some things I was familiar with along with things I did not know. I was especially grateful for his quick course in using vim! I had resisted learning how to use it, but it was really helpful for coding in Bash. I only had to learn a couple of keystrokes to do what I needed. And I knew at the end of two weeks that I wanted to continue learning Bash scripting.
I’ve done about 2 hours of the video in about 9 hours, so there is a lot more available to learn. I think it’s going to go slower now that I’m into what I know less about. Dave has provided the files with the code he goes over in each short lecture, so I am using that as a written reference to study and practice writing it. Someone told me about shellcheck which I installed easily on my Linux system. That program analyzes the code and shows errors in it. Very handy when what I write doesn’t work!
I don’t know how much use I’ll get from this, but I do know that I’m enjoying the process. That’s the main reason I’m doing it. If I can do something like process a bunch of files using a loop, I’ll be very happy.