forget about the environment

Maybe this is obvious (and still flammable topic) for most of system administrators, but it worth to say it again.

You should never rely on the environment variables, unless you explicitly specify that in the documentation (which is still bad way in most cases). You script must work if there’s no PATH env. variable, or no EDITOR set, etc. Yes, it may say error to the end user in unresolvable conditions, as `svn ci` do if no EDITOR and no -m specified, but generally it shouldn’t fail.

Not `sh`, but `/bin/sh`, not `cat`, but `/bin/cat`! Remember it and you’ll save a lot of nerves for you and all those people that will use your tools.

Thank you.

Advertisements

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: