Tech and travel

Posts

Korn shell way of checking if environment variable is set

2007-07-04

Sometimes you have to check if a variable is set and exit if it’s not. The following code does it in a nice and simple way : error_mess="This environment variable should be set" : ${ORACLE_HOME:?$error_mess} The output looks like this : ./script.sh[3]: ORACLE_HOME: This environment variable should be set The script exits after checking ORACLE_HOME, none of the following commands get executed. I found this in the sample chapter of the The Korn Shell: Unix & Linux Programming Manual, 3rd Edition book.

Statspack summary

2007-07-04

This post is a summary of the Oracle Statspack Survival Guide. To install statspack : Create tablespace for it @?/rdbms/admin/spcreate (run as sysdba) To take snaps : exec statspack.snap; To create the report : @?/rdbms/admin/spreport.sql

Automating FTP

2007-07-02

Here’s how you automate FTP : ftp -v -n hostname << EOF user usuario password bin put filename bye EOF With thanks to this post.

More Google maps stuff

2007-06-26

This Google Maps API Tutorial website has some very good how-tos on Google Maps. Needless to say, I added some of those things like Fitting the map to the data and Lots of sidebar entries to my maps. Check out the New Zealand and Firenze maps.

HP Unix info

2007-06-21

This is useful on HP Unix machines. It just prints out a few pieces of data of the machine. echo "HP Unix version : " `uname -a` echo "Model : " `/usr/bin/model` echo "Number of processors : " `/usr/sbin/ioscan -kf | grep processor | wc -l` An example output would be be : HP Unix version : HP-UX machine B.11.23 U ia64 ident_nr unlimited-user license Model : ia64 hp server rx4640 Number of processors : 4

Copyright (c) 2025 Michel Hollands