TOC PREV NEXT INDEX DOC LIST MASTER INDEX



Apex Shell Commands

This chapter describes the built-in commands available in Apex Shell. These commands are in addition to the standard cshell commands.

New commands are either Procedures or Functions.

Procedures

apex_shell_main <arguments>

Invokes a new copy of the Apex Shell interpreter on the given arguments within the same process. Sets the status variable.

break_here

Stop in the debugger at this statement.

clearcase [arguments]

This is a top-level command which is specific to ClearCase. It takes as its arguments the same arguments that would be given in a cleartool command line (without the word cleartool). When invoked as a function, the output from the cleartool command is returned as a string with embedded newlines.

After any clearcase command, the shell variable $clearcase_status will be set to the numeric ClearCase status value.

create_link <source> <target>

Create a symbolic link named <source> which refers to <target>. Sets last_error.

create_path <pathname>

Create the directory path given. Sets last_error.

create_pipe

Returns a 2 token string with the integer File_Descriptor numbers of a created pipe. Sets last_error.

editor_to_server <editor_name>

Maps an Editor_Name to its Server_Name.

kill_process [-<signal>] <process_id>

If <signal> is given, it can be an integer or a signal name without the SIG.

kill_group [-<signal>] <process_group_id>

If <signal> is given it can be an integer or a signal name without the SIG.

local <var> [= <value>]

Declare a variable local to a function. It can only be dereferenced within the function and ceases to exist when the function returns. It can also be used in a main program.

main_editor <editor_name>

For secondary editor's like Jobs, returns the name of the controlling editor.

return [<value>]

Return a value from a function.

server_to_editor <server_name>

Maps a Server_Name to its main editor.

set_variable <target_var_name> <var_name>

Assign the value of Var_Name to Target_Var_Name.

setg <var> = <value>

Assign to a global variable.

show_type_names

Show the names of all built-in types.

sleep <number>

Sleep the given number of seconds.

stack

Display the interpreter's runtime stack.

unsetg <var>

Unset a global variable.

Functions

action_location <filename> <action_name>

Returns the line number of the action.

actions_in_file <filename>

Returns a list of the names of the actions in the given file.

clearcase_error [error_number]

Returns a string image for the indicated ClearCase error number. If error_number is not given, returns the image of the latest ClearCase error.

current_filename

Pathname of the current file being executed from.

current_line_number

Line number of the statement being executed.

is_object <name>

Returns 1, if there is a declared object with the given name.

is_qualified <name>

Returns 1, if the given name is a fully qualified pathname.

function_exists <name>

Returns 1 if a given user-defined function exists.

function_location <filename> <function_name>

Returns the line number of the function.

function_names <pattern>

Returns list of all defined functions whose name matches the given pattern.

functions_in_file <filename>

Returns a list of the names of the functions in the given file.

keyword_replace <source> <context>

Perform Apex keyword replacement on <source>. Returns the replaced string. Sets last_error.

local_dir

Returns the string name of the Apex local directory.

object_filter <name> <pathname_filter>

Returns 1 if the given name matches the given filter string.

parameter <number>

Get the indicated parameter, first parameter is 1; an alternative to $1, etc., allowing iteration over all parameters

parent_process

Returns the process id of the parent process.

parm_count

The number of parameters.

process_exists <process_id>

Returns 1 if a given process exists.

process_group [<process_id>]

Return the process group id of the current process (or the given process).

resolve_script <simple_name>

Resolve a script name against the script_path. Returns the full pathname or the original name if it doesn't resolve

split_path <value>

Split a colon separated path value into a space separated string of the individual values.

String Functions

character <integer>

Returns a one character string from the given character code.

char <value> <index>

Returns the index'th character of the string. The first index is 0

length <value>

Length of a string

locate <s> <t> [<start>]

Return index of first occurrence of s within t. If start is not given, start = 0

locate_any <s> <t> [<start>]

Return index of first occurrence of any char from s in t. If start is not given, start = 0

lower <value>

Lowercase a string.

newline

Returns a string which is a newline.

reverse_locate <s> <t> [<start>]

Like locate starting from end of string and scanning backwards.

reverse_locate_any <s> <t> [<start>]

See locate_any and reverse_locate.

sprintf <format> <number>

Apply <number> to the <format> string and return the resulting string.

strip <value>

Remove leading and trailing blanks

substring <value> <start> <len>

String substring operator.

tab

Returns a string which is a tab

upper <value>

Uppercase a string.

Apex Related Functions

cpath <name>

Get the canonical pathname of the given argument.

is_view <name>

Returns 1 if name identifies a view.

is_subsystem <name>

Returns 1 if name identifies a subsystem.

subsystem_name <name>

Get the enclosing subsystem of a filename.

view_name <name>

Get the enclosing view of a filename.

Apex Component-enabled Functions

ada_enabled

Returns 1 if Apex Ada operations are enabled.

cpp_enabled

Returns 1 if Apex C/C++ operations are enabled.

only_ada

Returns 1 if Apex Ada operations are enabled, and C/C++ operations are not.

only_cpp

Returns 1 if Apex C/C++ operations are enabled, and Ada operations are not.

taskmgmt_enabled

Returns 1 if Summit task operations are enabled.

Network-Related Functions

host_to_machine <host machine number>

Convert host machine number to machine name.

machine_to_host <machine name>

Convert machine name to host machine number.

machine_to_ip <machine name>

Convert machine name to IP address (Dotted IP form).

ip_to_machine <IP address>

Convert IP address to machine name.

Other Functions

attribute_names

Returns an object of type string_map of session attribute names.

getenv <name>

Retrieve an environment variable.

get_task_names [<domain>]

Returns a list of the full pathnames of all Summit tasks in the given domain or the default domain if no argument is given.

get_task_array [<domain>]

Like Get_Task_Names but it returns an object of type string_array with the task pathnames.

qualify <name> <context>

Fully qualify a pathname.

rational_dir

Returns the string name of the users's .Rational directory.

resolve_tasks <arguments>

Resolves the given arguments like the -task option does.

temp_dir

Returns the string name of the Apex temp directory.

tempname [<prefix> [<dir>]]

Generate a temp file full pathname; uses temp_dir, if no dir is given.


Rational Software Corporation 
http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2001, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS