|
Programming HowTo's -
General How To's
|
|
Written by ikenticus
|
|
Tuesday, 06 May 2008 23:34 |
|
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").
|
|
Last Updated on Monday, 12 May 2008 20:10 |
|
Read more...
|
|
|
Programming HowTo's -
General How To's
|
|
Written by ikenticus
|
|
Wednesday, 30 April 2008 22:10 |
|
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.
|
|
Last Updated on Monday, 12 May 2008 20:09 |
|
Read more...
|
|
|
|
|
|