A P P E N D I X  A

Modifying Shell Scripts

This appendix describes how to modify Sun MTP shell scripts for your application environment. It includes the following topics:

Modifying Shell Scripts

Sun MTP uses shell scripts located in the $UNIKIX/bin directory to invoke utility programs. You can tailor these scripts to fit your application environment. Usually, you only need to customize the kixprint, kixjournal, and kixed shell scripts. Change the other scripts only if your site has specific operational requirements.

Note - When you modify a shell script, it becomes part of your application source code and you are responsible for maintaining it.

procedure icon  To Modify a Shell Script

1. Copy the script you want to modify and save it in the $UNIKIX/local/bin directory.

2. Use a text editor to make changes to the script and save it.

3. Start the region by executing the startup shell script kixstart, with the -l option to execute your customized script instead of the default version.

This option specifies the location of your customized executable files.

Refer to the Sun Mainframe Transaction Processing Software Reference Guide for more information about the command-line options of unikixmain.

Refer to the Sun Mainframe Transaction Processing Software Configuration Guide for information about modifying the kixprint shell script.

Changing the Default Editor

Sun MTP uses vi as its default editor. You can change the default by modifying the kixed shell script.

procedure icon  To Change the Default Editor

1. Copy the kixed script and save it in the $UNIKIX/local/bin directory.

2. Change the script, replacing the statement that executes vi with the if statement that evaluates an environment variable.

In this example, the environment variable is $EDITOR. The if statement checks if $EDITOR is set. If it is, the shell script calls the editor specified in the EDITOR environment variable. If $EDITOR is not set, vi is used.

if test -n "$EDITOR"
	vi $FILENAME <$2 >$2

3. Save the script.

The next time you start the region with the kixstart -l option, your new editor is the default.