PHP as a general scripting language

Invariable working smart involves automation, and automation will almost always involve scripting repetitive tasks.

Under *nix operating systems you could write a shell script, though the syntax is arcane and maintainability isn’t really achievable for a script of any complexity.

Under Windows you can write a bat/cmd script; but the language isn’t very powerful, nor is it robust.

A good choice for all operating systems is PHP5.

Yes, you will likely have to install it — but given that PHP5 is a useful tool, free, and runs on every modern computing platform that shouldn’t be a hurdle.

PHP is a rich scripting environment.  And if you’re interested in doing any web programming you can leverage your general scripting experiences to help you learn the language and become proficient.

One language to rule them all…

Well, that might be a little over the top.  PHP is certainly powerful and flexible — but still languages like C# and Java have their uses (as well an un-managed languages like C/C++).

The best way to get used to PHP is just start using it any time you’d normally write a script in some other language.  The syntax is fairly straight forward, and the available libraries/objects are rich.

For the foreseeable future I’ll be writing my scripts in PHP, and leaving shell programing, batch files, and voodoo to others.

http://php.net/

Originally posted 2010-03-27 02:00:04.