A Script Template and Useful Techniques for ksh Scripts
http://www.sun.com/bigadmin/content/submitted/ksh_script_template.jsp
see also the comments for the script
template in the wiki:
| Version |
Releasedate |
Description |
| 1.22.33 |
12.02.2009 |
## 1.22.31
18.03.2008 /bs ## added the version number to the start and end messages ## an existing config file is now removed (and not read) if the script is called with -C to create a config file ## ## 1.22.32 04.04.2008 /bs ## minor changes for zone support ## ## 1.22.33 12.02.2009 /bs ## disabled the usage of prtdiag due to the fact that prtdiag on newer Sun machines needs a long time to run ## (-> __MACHINE_SUBTYPE is now always empty for Solaris machines) ## added the variable __CONFIG_FILE_FOUND; this variable contains the name of the config file ## read if a config file was found ## added the variable __CONFIG_FILE_VERSION |
| 1.22.30 | 28.02.2008 /bs | ## 1.22.28
12.01.2008 /bs ## corrected a syntax error in the show usage routine ## added the function PrintWithTimestamp (see credits above) ## ## 1.22.29 31.01.2008 /bs ## there was a bug in the new code to remove the lockfile which prevented ## the script from removing the lockfile at program end ## if the lockfile already exist the script printed not the correct error ## message ## ## 1.22.30 28.02.2008 /bs ## Info update: executeCommandAndLog does NOT return the RC of the executed ## command if a logfile is defined ## added inital support for CYGWIN ## (tested with CYGWIN_NT-5.1 v..1.5.20(0.156/4/2) ## Most of the internal functions are NOT tested yet in CYGWIN ## GetCurrentUID now supports UIDs greater than 254; the function now prints the UID to STDOUT ## Corrected bug in GetUserName (only a workaround, not the solution) ## now using printf in the AskUserRoutine |
| 1.22.27 |
29.12.2007 /bs |
## ## 1.22.24 05.10.2007 /bs ## another minor fix for ksh93 compatibility ## ## 1.22.25 08.10.2007 /bs ## only spelling errors corrected ## ## 1.22.26 19.11.2007 /bs ## only spelling errors corrected ## ## 1.22.27 29.12.2007 /bs ## improved the code to create the lockfile (thanks to wpollock for the info; see ## credits above) ## improved the code to create the temporary files (thanks to wpollock for the info; see ## credits above) ## added the function rand (thanks to wpollock for the info; see credits above) ## the script now uses the directory name saved in the variable $TMPDIR for temporary files ## if it's defined ## now the umask used for creating temporary files can be changed (via variable __TEMPFILE_UMASK) see this wiki entry |
| 1.22.23 | 25.09.2007 /bs | 1.22.20 12.09.2007
/bs the script now checks the ksh version if running on Solaris made some changes for compability with ksh93 1.22.21 18.09.2007 /bs (BigAdmin Version 2) added the variable __FINISHROUTINES changed __REQUIRED_ZONE to __REQUIRED_ZONES added the variable __KSH_VERSION reworked the trap handling 1.22.22 23.09.2007 /bs added the signal handling for SIGUSR1 and SIGUSR2 (variables __SIGUSR1_FUNC and __SIGUSR2_FUNC) added user defined function for the signals HUP, BREAK, TERM, QUIT, EXIT, USR1 and USR2 added the variables __WARNING_PREFIX, __ERROR_PREFIX, __INFO_PREFIX, and __RUNTIME_INFO_PREFIX the parameter -T or --tee can now be on any position in the parameters the default output file if called with -T or --tee is now /var/tmp/${0##*/}.$$.tee.log 1.22.23 25.09.2007 /bs added the environment variables __INFO_PREFIX, __WARNING_PREFIX, __ERROR_PREFIX, and __RUNTIME_INFO_PREFIX added the environment variable __DEBUG_HISTFILE reworked the function to print the usage help : use "-h -v" to view the extented usage help and use "-h -v -v" to view the environment variables used also |
| 1.22.19 |
08/04/2007 |
1.22.16 05.07.2007
/bs enhanced initial support for other Operating Systems Support for other OS is still not fully tested! 1.22.17 06.07.2007 /bs added the global variable __TRAP_SIGNAL 1.22.18 01.08.2007 /bs __OS_VERSION and __OS_RELEASE were not set - corrected 1.22.19 04.08.2007 /bs wrong function used to print "__TRAP_SIGNAL is \"${__TRAP_SIGNAL}\"" - fixed |
| 1.22.15 |
11/23/2006 |
1.22.11 19.10.2006
/bs corrected a minor bug in AskUser (/c was not interpreted by echo) corrected a bug in the handling of the parameter -S (-S was ignored) 1.22.12 31.10.2006 /bs added the variable __REQUIRED_ZONE 1.22.13 13.11.2006 /bs the template now uses TMP or TEMP if set for the temporary files 1.22.14 14.11.2006 /bs corrected a bug in the function AskUser (the default was y not n) 1.22.15 21.11.2006 /bs added initial support for other Operating Systems corrected some bugs in the debug handler |
| 1.22.10 |
09/20/2006 |
1.22.4 06.07.2006
/bs corrected a bug in the parameter error handling routine 1.22.5 27.07.2006 /bs corrected some minor bugs 1.22.6 09.08.2006 /bs corrected some minor bugs 1.22.7 17.08.2006 /bs add the CheckParameterCount function added the parameter -T added long parameter support (e.g --help) 1.22.8 07.09.2006 /bs added code to save the env variable LANG and set it temporary to C 1.22.9 20.09.2006 /bs corrected code to save the env variable LANG and set it temporary to C 1.22.10 21.09.2006 /bs cleanup comments the number of temporary files created automatically is now variable (see the variable __NO_OF_TEMPFILES) added code to install the trap handler in all functions |
| 1.22.3 |
06/24/2006 |
1.22.2. 21.06.2006
/bs added the parameter -V added the use of environemnt variables added the variable __NO_TIME_STAMPS added the variable __NO_HEADERS corrected a bug in the function executeCommandAndLogSTDERR added missing return commands 1.22.3 24.06.2006 /bs added the function StartStop_LogAll_to_logfile added the variable __USE_TTY (used in AskUser) corrected an spelling error (dev/nul instead of /dev/null) |
| 1.20.0 |
08/01/2005 |
some enhancements and bug fixes |
| 1.18.2 |
03/18/2005 | minor bug fixes |
| 1.18.0 |
02/02/2005 |
see also the documentation

