View Single Post
Old 4th February 2012
thirdm thirdm is offline
Spam Deminer
 
Join Date: May 2009
Posts: 248
Default

Quote:
Originally Posted by ocicat View Post
While I understand why you made this statement, I will nevertheless push back. Some of the most useful pieces of code I have written which I come back to time & again are shell scripts to backup & restore, plus build bootable USB flash drive configurations. They are not elaborate, but the bootable USB configuration script is over 250 lines. Shell scripting isn't sexy, but gluing together common Unix tools is a useful & practical skill. Could these be rewritten in Perl and/or Python? Given how I use these tools, keeping them compatible to OpenBSD's base configuration is a useful feature, so that excludes Python. Could they be rewritten in Perl? Sure (& I considered this at the time...), but there isn't much to gain. The scripts work quite fine as they are now, so until I have reason to revisit the decision, they will continue to be maintained & tweaked as shell scripts.
I will agree for the person starting with Unix, shell scripting is a good place to start. Some could argue that you could go directly to Perl, Python, Ruby, scsh, lua, Tcl, or something else and get more regular syntax or fuller capabilities (the scsh paper's worth a read, but perhaps not until after OP has learned some shell and C)..., but then you would miss out on appreciating the approach to programming that's described so well in a book like The Unix Programming Environment.

I find myself lately wanting to do everything through emacs, scsh and Common Lisp. But I've bounced back and forth on this over the years. Sometimes even now I read how others work, quotes like, "the Unix environment is my IDE," and find myself wistful, almost ready to bounce the other way again and become for a while a vi/awk/shell/C person or an acme/awk/rc/C/plan9 person.

Still, I hate the quoting rules and lack of types in shell. Just my preference. No one should take that as advice, but instead try it and decide themselves what they like.
Reply With Quote