ZEDit

The ZEDIT command invokes the editor specified by the EDITOR environment variable for GT.M and opens the specified file for editing. If the EDITOR environment variable is undefined, ZEDIT tries to invoke the UNIX vi editor.

By default, ZEDIT puts a new file into the first source directory in $ZROUTINES. You can specify a file path explicitly in the argument to the ZEDIT command, for example: the current working directory:

ZEDIT "./file"

The format of the ZEDIT command is:

ZED[IT][:tvexpr] [expr[,...]]

If the expression includes a directory, ZEDIT searches only that directory. If $ZROUTINES is not null, a ZEDIT command that does not specify a directory uses $ZROUTINES to locate files. If $ZROUTINES is equal to an empty string, ZEDIT edits a file in the current working directory. For more information on $ZROUTINES, see the appropriate section in Chapter 8: “Intrinsic Special Variables.

When the argument to a ZEDIT includes a file or path name, $ZSOURCE maintains that as a default for ZEDIT and ZLINK. For more information on $ZSOURCE see the appropriate section in Chapter 8: “Intrinsic Special Variables.

Examples of ZEDIT

Example:

GTM>ZEDIT "BAL"

This invokes the editor for a file with a name of BAL and an extension of .m. Notice that BAL is a string literal.

Example:

GTM>Set prog="BAL"
                
GTM>ZEDit prog

This is similar to the first example except that it uses a variable argument rather than a string literal.

Example:

GTM>zedit ".login"

This invokes the editor for a file with the name .login. Notice that in this case the file is not a GT.M file, since .login starts with a period, and therefore, cannot be a GT.M file.