Version | Releasedate | Description |
2.3.0.0 | 10.11.2017 | ##V# 2.3.0.0 10.11.2017 /bs scriptt.sh ##V# added the variable __RUNNING_IN_TERMINAL_SESSION ##V# added the function print_runtime_variables ##V# enhanced the function DebugShell ##V# default user defined trap handler for CTRL-C is now DebugShell ##V# edit the line ##V# __SIGNAL_SIGINT_FUNCTION="DebugShell" ##V# to change this behaviour ##V# or use ./scriptt.sh -D setvar:__SIGNAL_SIGINT_FUNCTION="" ##V# if the script is called with redirected STDIN and without the parameter -q ##V# all output for STDOUT and STDERR is now redirected to the file ##V# /var/tmp/${0##*/}.STDOUT_STDERRR.$$ ##V# removed the variables SCRIPT_USER and SCRIPT_USER_MSG ##V# added the variables __PROCS_TO_KILL and __PROCS_KILL_TIMEOUT to ##V# define processes that should be stopped at script end ##V# the debug switch "-D tracefunc" can now be used more then one time ##V# the debug switches "-D tracefunc" and "-D debug" can be used at the same time ##V# the debug switch "-D tracefunc" now supports the variable ${.sh.func} if running in ksh93 ##V# added the debug switch "-D DebugShell" to call the DebugShell while processing the parameter ##V# fixed a typo: renamed __ingoretraps to __ignoretraps ##V# the function f() to check the ksh version is now deleted after it is used ##V# "typeset -f" replaced with "typeset +f" where applicable ##V# the default value for the debug switch "-D cleanup" is now "all" ##V# added the variable __TYPESET_F_SUPPORTED; this variable is set to "yes" if "typeset -f function" ##V# can be used to print the statements of a function in the used shell ##V# the debug switch "-D tracefunc" and the aliase for tracing in DebugShell now add the statements ##V# typeset __FUNCTION=<function_name> ; ${__DEBUG_CODE}; ##V# to a function if neccessary, and "typeset -f" is supported by the shell used ##V# the cleanup function now supports parameter for the exit routines ##V# the cleanup function now supports parameter for the finish routines ##V# added the variable __INSIDE_EXIT_ROUTINE ##V# added the variable __INSIDE_FINISH_ROUTINE |
Version |
Releasedate |
Description
|
2.2.0.2 | 24.10.2016 | ##V# 2.2.0.2 24.10.2016 /bs ##V# SDTERR in DebugShell was not redirected to /dev/tty -- fixed ##V# DebugShell returns now immediately if not running in an interactive session |
2.2.0.1 | 17.01.2016 | ##V# 2.2.0.1 17.01.2016
/bs ##V# the content of the environment variable __DEBUG_CODE was not used -- fixed ##V# adding -f to the rm and mv commands in BackupFileIfNecessary ##V# __BACKUP_FILE was not always set to the correct value in BackupFileIfNecessary - fixed ##V# now BackupFileIfNecessary returns ${__FALSE} if one or more backups failed |
2.2.0.0 |
09.01.2016 |
##V# 2.2.0.0 09.01.2016
/bs ##V# the function GetKeystroke did not process the parameter - fixed ##V# GetKeystroke did not check for CTRL-C - fixed ##V# the function GetKeystroke now supports the parameter [lower|upper] to convert the user input ##V# to lowercase or uppercase; the real user input is still available in the global variable RAW_USER_INPUT ##V# the script now prints the actions that would have been done in the cleanup routine if __NO_CLEANUP is set ##V# added the parameter -D nocleanup (shortcut for -D setvar:__NO_CLEANUP=0) ##V# added the parameter -D cleanup[=type] to enable/disable the house keeping ##V# die() will now again end the script even if -f was used ##V# includeScript now checks the syntax of an include script ##V# added the function tryIncludeScript ##V# added the parameter -D showdefaults ##V# added the parameter -D tracemain ##V# corrected some errors in the messages written by the script ##V# reworked the comments in the script ##V# added the variable __START_DIR_REAL |
2.1.0.11 | 26.11.2015 | ##V# 2.1.0.11 26.11.2015 /bs ##V# moved initialisation of __SCRIPTNAME, __SCRIPTDIR, and |
2.1.0.10 | 16.11.2015 | ##V# 2.1.0.10 16.11.2015 /bs ##V# replaced code incompatible with some ksh versions |
2.1.0.9 | 26.10.2015 | ##V# 2.1.0.9 26.10.2015 /bs ##V# added the keyword printargs to the parameter -D ##V# BackupFileIfNecessary now supports rotating backups, e.g. ##V# file.0, file.1, file.3, ... ##V# To use that feature the new format of the parameter for the ##V# function is: ##V# ##V# BackupFileIfNeccessary [file{,no_of_backups}] [...] ##V# ##V# In the default configuration the script now creates a new log ##V# file for each execution of the script and retains up to ##V# 10 backups of the log file. ##V# To overwrite the number of backups use the following syntax for ##V# the parameter -l: ##V# ##V# -l logfile,[no_of_backups_of_the_logfile] ##V# ##V# The default number of backups for the log file is configured in the variable ##V# MAX_NO_OF_LOGFILES |
2.1.0.8 | 09.09.2015 | ##V# 2.1.0.8 09.09.2015 /bs ##V# added the variable __SETOPTS and the alias __TRACE_ACTIVE |
2.1.0.7 |
25.07.2015 |
##V# 2.1.0.7 25.07.2015
/bs ##V# added the parameter -D dryrun. To use dryrun in your code ##V# add the prefix "${PREFIX}" to every external command executed ##V# by your script ##V# added the parameter -D list_rc to list all return codes used in the script ##V# (only works if you only use "die" to end the script) |
2.1.0.6 | 08.07.2015 | ##V# 2.1.0.6 08.07.2015 /bs ##V# Added the parameter "-D debug" |
2.1.0.5 | 08.05.2015 | ##V# 2.1.0.5 08.05.2015 /bs ##V# LogRuntimeInfo did not work in the default ksh from Solaris 11 --fixed ##V# |
2.1.0.4 | 25.12.2014 | ##V# 2.1.0.4 25.12.2014 /bs ##V# __SCRIPTDIR was wrong if the script was called with the name only |
2.1.0.3 | 12.12.2014 | ##V# 2.1.0.3 12.12.2014 /bs ##V# added the variable ${__BACKUP_FILE} to BackupFileIfNecessary ##V# |
2.1.0.2 | 08.11.2014 | ##V# 2.1.0.2 08.11.2014 /bs ##V# corrected a bug in code for the parameter "-D fn_to_device=filename" ##V# added ${__FUNCTION_EXIT} to some of the functions ##V# |
2.1.0.2 | 06.11.2014 | ##V# 2.1.0.2 06.11.2014 /bs ##V# Added the parameter "-D create_dump=d" ##V# the function rand now uses nawk in Solaris and awk in all other OS |
2.1.0.1 |
04.11.2014 |
##V# 2.1.0.1 04.11.2014
/bs ##V# Added the parameter variable__DEBUG_PREFIX ##V# Added the function LogDebugMsg ##V# Added the parameter "-D listfunc" ##V# Added the parameter "-D fn_to_device=filename" ##V# corrected a minor bug in the parameter handling for the parameter "-D" |
2.1.0.0 |
02.11.2014 |
##V# 2.1.0.0 02.11.2014
/bs ##V# Added the parameter -D SyntaxHelp to print syntax usage examples for the template ##V# Added the parameter -D debugcode="x" ##V# Added the parameter -D tracefunc=f1 ##V# Added the parameter -D setvar:name=value ##V# Added the parameter -D create_documentation ##V# Added more usage information for the template |
2.0.0.7 |
27.04.2014 |
##V# 2.0.0.7 27.04.2014
/bs ##V# AskUser now save the last input in the variable LAST_USER_INPUT, to enter ##V# this value again use "#last" ##V# Version parameter (-V) usage enhanced: use "-v -v -V" to print also the version ##V# history; use "-v -v -v -V" to also print the template version history. |
2.0.0.6 |
27.01.2014 | #### 2.0.0.6 27.01.2014
/bs #### added the function PrintLine #### added the functions GetSeconds, GetMinutes, ConvertMinutesToHours, #### and GetTimeStamp #### added the debug options fn_to_stderr, fn_to_tty, and fn_to_handle9 #### max. return value for a function is 255 and therefor the functions #### for the stack and the functions pos and lastpos now abort the #### script if a value greater than 255 should be returned #### added the variables __SHEBANG, __SCRIPT_SHELL, and __SCRIPT_SHELL_OPTIONS #### added the function DebugShell #### AskUser now has a hidden shell; use "shell<return>" to call the DebugShell #### set __DEBUG_SHELL_IN_ASKUSER to ${__FALSE} to disable the DebugShell #### in AskUser #### added the function ConvertDateToEpoc |
2.0.0.5 | 08.01.2014 | #### 2.0.0.5 08.01.2014 /bs #### added the function executeFunctionIfDefined |
2.0.0.4 | 01.01.2014 | #### 2.0.0.4 01.01.2014 /bs #### the alias __settrap is renamed to settraps (with leading s) #### two new aliase are defined: __ingoretraps and __unsettraps #### whence function for non-ksh compatible shells rewritten #### without using ksh #### the switch -D is now used to toggle debug switches #### known debug switches: #### help -- print the usage help for -D #### msg -- log debug messages to /tmp/<scriptname>.<pid>.debug #### trace -- activate tracing to the file /tmp/<scriptname>.<pid>.trace #### AskUser now accepts also "yes" and "no" #### function IsFunctionDefined rewritten #### now __LOGON_USERID and __USERID are equal to $LOGNAME until I #### find a working solution #### (the code in the previous version did not work if STDIN is not a tty) |
2.0.0.3 | 16.12.2013 | #### 2.0.0.3 16.12.2013 /bs #### now the Log-* functions return ${__TRUE} if a message is printed #### and ${__FALSE} if not |
2.0.0.2 | 01.09.2013 | #### 2.0.0.2 01.09.2013 /bs #### added the variables __SYSCMDS and __SYSCMDS_FILE |
2.0.0.1 | 06.08.2013 | #### 2.0.0.1 06.08.2013 /bs #### added the variable __MACHINE_SUB_CLASS. Possible values #### for sun4v machines: either "GuestLDom" or "PrimaryLDom" |
2.0.0.0 |
31.05.2013 |
#### 2.0.0.0 17.05.2013 /bs #### added the variable __GENERAL_SIGNAL_FUNCTION: This variable #### contains the name of a function that is called for all SIGNALs #### before the special SIGNAL handler is called #### removed the Debug Handler for single step execution (due to the #### length of the template it is not useful anymore; use the #### version 1.x of scriptt.sh if you still need the Debug Handler) #### function executeCommandAndLogSTDERR rewritten #### removed the function CheckParameterCount #### use lsb_release in Linux to retrieve OS infos if available #### minor fixes for code and comments #### replaced PrintWithTimeStamp with code that does not use awk |
... (see here
for the old history entries) |
||
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 |
Known
debug switches for scriptt.sh[xtrnaw7@t540p /data/develop/scripts]$ ./scriptt.sh -D
help
[11.11.2017 12:02:29] scriptt.sh v1.0.0 started at Sat Nov 11 12:02:29
CET 2017.
[11.11.2017 12:02:29] Reading the config file
"/data/develop/scripts/scriptt.conf" ...
Known debug switches (for -D / --debug):
help --
show this usage and exit
create_documentation
-- create the script documentation
list_rc -- list return codes
used by this script
Works only if you only use "die" to end the script
msg
-- log debug messages to the file /tmp/scriptt.sh.1712.debug
This parameter should be the first parameter.
trace -- activate
tracing to the file /tmp/scriptt.sh.1712.trace
tracemain -- trace the main function
fn_to_stderr -- print the function names to STDERR
fn_to_tty -- print the function names to
/dev/tty
fn_to_handle9 -- print the function names to the file handle 9
fn_to_device=filename
-- print the function names to the file "filename"
debugcode="x" -- execute the debug code "x" at every function
start
CAUTION: The debug code should NOT write to
STDOUT - use STDERR instead
printargs -- print the script arguments
tracefunc=f1[,...,f#]
-- enable tracing for the functions f1 to f#
debug[=cmd] -- exeucte the command "cmd" or call a
very simple cmd loop
DebugShell -- start the DebugShell
setvar:name=value
-- set the variable "name" to "value"
listfunc -- list all functions
defined and exit
showdefaults -- show the default variable values
create_dump=dirname
-- enable environment dumps; target directory is dirname
SyntaxHelp -- print syntax usage examples for
the functions in the template
and exit
dryrun -- dry run only,
do not execute commands
dryrun=prefix -- dry run only, add the prefix "prefix" to all
commands
nocleanup -- disable the house keeping at
script end
cleanup[=type]
-- disable or enable the house keeping at script end; "type" can be
all - enable all house keeping (this is the default)
none - disable all house keeping
nodelete - disable only removing of temporary files and directories
[11.11.2017 12:02:29] The log file used was
"/tmp/scriptt.sh.1712.TEMP"
[11.11.2017 12:02:29] The debug messages are logged to
"/tmp/scriptt.sh.1712.debug"
[11.11.2017 12:02:29] scriptt.sh v1.0.0 started at Sat Nov 11 12:02:29
CET 2017 and ended at Sat Nov 11 12:02:29 CET 2017.
[11.11.2017 12:02:29] The time used for the script is 0 minutes and 0
seconds.
[11.11.2017 12:02:29] The RC is 0.
[xtrnaw7@t540p /data/develop/scripts]$
http://www.shelldorado.com/ |
Heiner's Shell Dorado |
http://apenwarr.ca/log/?m=201102#28 |
Insufficiently known POSIX shell features |
http://blog.fpmurphy.com/2008/10/ksh93-date-manipulation.html |
ksh93 builtin time formatting with
printf examples |
http://www.unix.com/unix-dummies-questions-answers/13018-exit-status-command-pipe-line.html#post47559 |
source for the function
executeCommandAndLog |
A minimal Version of scriptt.sh is here: http://bnsmb.de/solaris/scriptt_mini.html.