May 072008
 

As the title suggests, there is always more than one way. For a popular scripting language like perl, the number of variations can lead to both better and worse code. Others, like bash and expect, have certain limitations that make it a bit more cumbersome for some undertakings but, with a bit of logic, there are usually workarounds (never let it be said that "until" is a necessary conditional function when there exists "while").

Continue reading “Basics 102: To Skin a Cat (Or To Xen a MAC)” »

May 012008
 

Watch as a red snake breaks open an oyster anticipating a new designer drug…no, that’s not what that title means. Actually, this is a scripting tutorial of some basic methods like getopts, variable manipulation, output formatting, conditionals and functions/subroutines. Scripting languages translate very much like Romance Languages — usually the quickest way to learn a second one is to simply translate your knowledge of the first one. A year ago, I had written a Zenoss-v1 device script in python, perl and bash for a friend to adjust to python with his knowledge of perl.

Originally, I was going to post it as is in this community, but since I’m not sure if the latest version of Zenoss supports it anymore, I figured it would be better to simplify it and added two more languages in the mix. If there are additional requests, we can expand this to cover some additional methods. All scripts are designed to produce the same exact output (with the exception of the debug output, which is language-based) and are structured identically so that you can understand them side-by-side.

Continue reading “Basics 101: ruby python bash perl expect php” »


Warning: fopen(/home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/lib/standard.txt) [function.fopen]: failed to open stream: No such file or directory in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 104

Warning: fread(): supplied argument is not a valid stream resource in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 105

Warning: fclose(): supplied argument is not a valid stream resource in /home/dynasty/linuxdynasty.org/wp-content/plugins/wp-google-plus-one/plusone.php on line 106
.