I've gone through a few good resources on bash/shell commands, trying to get comfortable with the command line interface, but I wasn't quite feeling comfortable still. One of my Dev Bootcamp guides suggested that I try writing a shell script as a way to get a bit better. So I wrote one that checks first for whether it's been passed any arguments. If it doesn't get any, it prints out instructions for the user; if it does get some, it checks whether each argument is a software that is installed, and prints out whatever it finds.

There were a few stuggles and a few very interesting moments with this project. For one thing, I already knew a bit about ARGVs and could assume that a shell script could recognize and iterate over an array. I also assumed that there was some way to create a conditional flow. Both of these assumptions helped a lot with googling for the commands. I found this awesome resource and used it as a command cheatsheet. I decided to use this one to test if ARGVs were empty:

That's where my confusion, still unresolved, comes in. I passed it $@, or what I understand is the ARGV array, and expected that [ -s $@ ] would fail because an empty array does not have a size greater than zero. But instead it works, and prints the following instructions only if the ARGV array has a size equal to zero! So I remain confused.

Still it did the trick—writing this script definitely helped me get greater confidence with writing shell commands! And I now have a much deeper respect and appreciation for Unix...