Man Page Index

Normally jkeyauto is run simply as "jkeyauto scriptname" but more options are available.

The options available are

Option Description
-ftimeout Set the timeout value for WAITing on a sync. lock.
-h or -? Display the help screen.
-i ignore any extranous INPUT statements.
-s Default to ignore any SLEEP statements in the script. This can subsequently be over-ridden by the SLEEP ON and SLEEP OFF statements within a script.
-t Turn on statement tracing. Every time a new line of script begins execution, jkeyauto will display the source line. Useful for tracing and debugging large scripts. See also the TRACE ON and TRACE OFF statements.
-x When jkeyauto exits, display to the terminal all the values of the variables created within the script.
-S Manipulate the sync. lock

The -S option can also be used which changes the functionality of jkeyauto. When the -S option is used, then instead of executing the named script, we do the sync. functionality using jkeyauto scripts. This is similar to the SYNC statement described earlier. When the -S option is used, the syntax for the jkeyauto command becomes

jkeyauto -S LOCK|UNLOCK|WAIT|TEST locknumber {-ftimeout}

See the description of the SYNC statement for the operation of this syntax.

-S LOCK shows that lock "locknumber" will be locked. No check is made on whether it is already locked or not, or if by the same instance of jkeyauto or not. The lock always works.

UNLOCK shows to unlock the lock "locknumber ". No check is made that the lock is already locked or that this instance of jkeyauto is the lock owner.

TEST allows you to see if "locknumber" is set or not. It does this silently and set the exit code of the program appropriately (see later).

WAIT allows you to wait until "locknumber" becomes unlocked.

-ftimeout allows you to add a timeout clause when the "-S WAIT" is used. Without this, then jkeyauto wait forever until the lock is unlocked. A value of 0 shows to return immediately.

The exit() code of jkeyauto will be set to show the success or not of the operation. For example in the Unix shell script the variable $? can be used to examine this exit code.

LOCK 0 shows the lock was taken. Any other value is the error number of a fatal error.
UNLOCK 0 shows the lock was unlocked. Any other value is the error number of a fatal error.
TEST 0 shows the requested lock is currently unlocked. 1 shows the requested lock is currently locked.
WAIT 0 shows the lock is unlocked or became unlocked. 1 shows the operation timed out. Any other value is the error number of a fatal error.