Hacker News new | past | comments | ask | show | jobs | submit | vartosis's comments login

As a dual wielding hat person (sysadmin and programmer), stay away from bash programming.

Use a modern scripting language like Python or Ruby otherwise you are entering a world of pain.

http://mywiki.wooledge.org/BashPitfalls


Dependencies are another huge issue if you want to be cross-platform. A Ruby script (for example) relies on the Ruby interpreter, which works the same cross-platform. If it has other dependencies, there's an established way to declare and install them.

In contrast, a bash program calls out to lots of little programs: sed, awk, grep, etc. Different platforms have different implementations which take different flags, etc.

My friend and I just spent a couple of days getting some bash scripts that ran fine under Cygwin to also run on OSX. It was painful.


Ruby system scripts assuredly do not work the same cross-platform, particularly if they have to call to C libraries. Expect to have to rejigger them just as you would bash.


I found PowerShell quite capable as both a shell and a programming language, scaling up to larger scripts and yet remain readable.

Pash sadly isn't complete enough to be used, though.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: