Linked by Eugenia Loli on Fri 14th Sep 2007 23:08 UTC
General Development As a system administrator, you run across numerous challenges and problems. Managing users, disk space, processes, devices, and backups can cause many system administrators to lose their hair, good humor, or sanity. Shell scripts can help, but they often have frustrating limitations. This is where a full-featured scripting language, such as Python, can turn a tedious task into an easy one. Python is a scripting language that looks like it was made for system administrators.
Thread beginning with comment 271554
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[4]: +1 for Perl
by Geoff Gigg on Sat 15th Sep 2007 15:23 UTC in reply to "RE[3]: +1 for Perl"
Geoff Gigg
Member since:
2006-01-21

I tried to take that route when converting a major system from Unix to Linux. The Unix system used Posix shell, and I thought the best approach would be to use bash with the Posix compliant switch turned on. Unfortunately, that was too limiting. There were several key features that were not present in the bash sh mode but did have an analogue in plain bash. Plus the fact that most Linux stuff was set to run bash by default, it meant I was continually having to be very sure what I was mixing. I finally bit the bullet and converted every script to bash. I guess I could have taken another approach, but this was more direct and made me happier in the long run.

(Not to mention that there are all sorts of other incompatibilities between Unix and Linux utilities that had to taken care of.)

I used C when required for speed or library calls, but no other scripting language. I did not want to introduce another tool unless absolutely necesary. Shell script can be verbose, but it can also be very nicely formatted and readable if you take the time.

If had to do it over again without the time constraints, maybe I would have chosen a scripting language to make it more portable in the future. But time always forces a less than ideal solution!

Reply Parent Score: 1

RE[5]: +1 for Perl
by Doc Pain on Sun 16th Sep 2007 15:57 in reply to "RE[4]: +1 for Perl"
Doc Pain Member since:
2006-10-08

Regarding your explaination, I surely would have taken the same way because bash (as /bin/bash) is the standard shell in Linux.

"(Not to mention that there are all sorts of other incompatibilities between Unix and Linux utilities that had to taken care of.)"

Good to see some UNIXes having a GNU userland. :-)

"I used C when required for speed or library calls, but no other scripting language. I did not want to introduce another tool unless absolutely necesary. "

I completely agree with the last sentence. While using additional scripting languages for system purposes may be a great learning approach with a massive gain of knowledge, it can lead to problems while you begin to assume the presence of a particular scripting interpreter on a system. And when you rely on it at startup time, you may fall back to maintenance mode and start searching for the reason of the interruption inside the startup procedures...

Use the right tool for every task. First, use the tools that you have at the most minimal level, and when you cross their border, then introduce other tools.

"Shell script can be verbose, but it can also be very nicely formatted and readable if you take the time."

Just have a look at the startup mechanisms of the BSDs available for x86 (FreeBSD, OpenBSD, NetBSD). Here, you will see sh scripts that are a joy to read (meaningful identifiers, well formatted text, comments etc.).

Reply Parent Score: 2