It is possible to write this commands as a separate program (a contributed command) and place it into the edrc/contrib/edrc directory. From then on the new contributed command can be called as if it is an edrc internal command. It is then listed in the section CONTRIBUTED COMMANDS when the help command in edrc is invoked.
This will protect you from loosing your work after an upgrade of edrc, simplifies the development of additional functionality for edrc and will keep the edrc command itself stable.
A contributed command has to comply with some conventions:
Example:
date > $EDRC_CONTRIB_VARDIR/my_command.begin
Example:
# @PROVIDES@ view display more grep tail head
This results in the contributed functionality being listed in the output of the edrcperm command within edrc in the form contrib.my_command.functionality .
Example:
   EDRC PERMISSIONS / FUNCTIONALITIES
     All:
        :
        contrib.logs.display  contrib.logs.grep     contrib.logs.head
        contrib.logs.more     contrib.logs.tail     contrib.logs.view
        :
To handle the denial of a functionality startup in a contributed command, the is_permitted(3) command has to be used.
Example:
if [ `is_permitted view` = True ]; then
        view $log >`tty`
fi
A contributed command consists of the following file structure:
As all edrc commands, the contributed commands do not receive command line options. All options have to be queried by the contributed command using for example the input(3) or choice(3) commands. See example 2) in the EXAMPLES section to see how to query user input.
See section ENVIRONMENT in the edrc(1m) manpage for a complete explanation of all exported environment variables.
The contributed command logtail :
        #!/bin/sh
        #
        # logtail - start logtail
        #
        # [00] 08.08.2004 CWa   Initial Version
        # [01] 25.01.2006 CWa   chg: command name ltail -> logtail      
        #
        test "$DEBUG" = True && set -x
        logtail
The nolog file logtail.nolog (the content of the logtail.nolog is not important. edrc only checks if the logtail.nolog file exists or not):
        #
        # logtail.nolog - flag file to prevent output logging
        #
        # [00] 26.01.2006 CWa   Initial Version
        #
        # If this file exists, the output of the relating
        # contributed command is not logged to a logfile.
        # 
        # This make sense if the contributed command
        # generates continuous output which would generate
        # very large logfiles.
        #
The contributed command cmviewcl :
        #!/bin/sh
        #
        # cmviewcl - MC/ServiceGuard state
        #
        # [00] 08.02.2003 CWa   Initial Version
        # [01] 18.03.2003 CWa   +opt    
        # [02] 10.05.2003 CWa   fix: DEBUG      
        # [03] 24.07.2003 CWa   +is_osid
        #
        test "$DEBUG" = True && set -x
        is_osid -s $0 -o HP-11,HP-11i || exit $?
        opt=`input "options" "" `
        msg INFO "MC/ServiceGuard state:"
        cmviewcl $opt | more
In addition some additional functionality that does not support the basic edrc functionality is first implemented as a contributed command and probably later integrated if all bugs are fixed and the decision is made to include it. In general there is no disadvantage to have some functionality available as contributed commands and not as a core edrc command.
The complete list of all contributed commands distributed with WA2L/edrc is given in the man page contrib.edrc(1m).
This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.