Aliases | |
---|---|
\alias | define or list aliases |
\alphanum | define alias |
\arg | define alias with default |
\export | put alias to environment |
\import | import alias from environment |
\store | save result from evaluate |
\unalias | remove alias |
Directories | |
\back | return to previous directory |
\cd | change working directory |
\dir | directory listing |
\mkdir | create directory |
\pwd | print working directory name |
Evaluate | |
\addeval | add a variable |
\evaluate | calculator |
\listeval | show stored variables |
\removeeval | remove a variable |
Files | |
@ | execute commandfile |
& | execute commandfile |
\command | show command list |
\dir | directory listing |
\edit | invoke editor |
\journal | copy input commands to file |
\overwrite | overwrite existing files |
\rename | rename file |
Flow Control | |
\exit | emulate end-of-file |
\fatal | terminate program |
\goto | skip statements |
\if | conditional execution |
\repeat | multiple execution |
Keyboard | |
@ | execute commandfile |
& | execute commandfile |
\bell | keyboard bell |
\help | try to display program help |
\journal | write input commands to file |
\pause | pause until user types go |
Process | |
\spawn | execute command as subshell |
\shell | create new shell |
Screen | |
\cls | clear screen |
\echo | echo input commands and command files |
\output | more or less output |
\title | display the rest of the line in the titlebar of the terminal window |
\wl | set terminal width to 132 |
\wn | set terminal width to 80 |
Timing | |
\cpu | show cpu time since last setcpu |
\date | show date |
\pause | wait for user (if interactive) |
\second | show cpu time since last setcpu |
\setcpu | initialize cpu timer |
\time | show time |
\wait | wait |
!check for 2 input arguments \if not alias $1' \exit \if not alias $2' \exit !now show the values of the arguments \alias $1 \alias $2
!substitute the arguments, but use defaults if absent \arg v $1 0.70 \arg w $2 something else !show the values \alias v \alias w
\alias | list all aliases |
\alias a | list specific alias a |
\alias a line | set alias a to line |
\echo on | echo all input commands |
\echo off | do not echo input commands |
\echo auto | echo input commands only from @files |
\echo debug | echo all input commands. Echo cannot be switched off anymore |
Expressions | |
---|---|
+ | add |
- | subtract |
* | multiply |
/ | divide |
** | power |
^ | power |
Functions (radians) | |
acos | arc cosine |
asin | arc sine |
atan | arc tangent |
atan2 | atan2 |
cos | cosine |
sin | sine |
tan | tangent |
Functions (degrees) | |
acosd | arc cosine |
asind | arc sine |
atand | arc tangent |
atan2d(f,g) | atan2 |
cosd | cosine |
sind | sine |
tand | tangent |
Boolean Tests | |
eq(f,g) | 1.0 if f is equal to g, else 0.0 |
eq(f,g,v,w) | v if f is equal to g, else w |
even(f) | 1.0 if f even, else 0.0 |
even(f,v,w) | v if f even, else w |
ge(f,g) | 1.0 if f is greater than or equal to g, else 0.0 |
ge(f,g,v,w) | v if f is greater than or equal to g, else w |
gele(f,g,h) | 1.0 if f is greater than or equal to g and less than or equal to h, else 0.0 |
gele(f,g,h,v,w) | v if f is greater than or equal to g and less than or equal to h, else w |
gelt(f,g,h) | 1.0 if f is greater than or equal to g and less than h, else 0.0 |
gelt(f,g,h,v,w) | v if f is greater than or equal to g and less than h, else w |
gt(f,g) | 1.0 if f is greater than g, else 0.0 |
gt(f,g,v,w) | v if f is greater than g, else w |
gtle(f,g,h) | 1.0 if f is greater than g and less than or equal to h, else 0.0 |
gtle(f,g,h,v,w) | v if f is greater than g and less than or equal to h, else w |
gtlt(f,g,h) | 1.0 if f is greater than g and less than h, else 0.0 |
gtlt(f,g,h,v,w) | v if f is greater than g and less than h, else w |
le(f,g) | 1.0 if f is less than or equal to g, else 0.0 |
le(f,g,v,w) | v if f is less than or equal to g, else w |
lt(f,g) | 1.0 if f is less than g, else 0.0 |
lt(f,g,v,w) | v if f is less than g, else w |
ne(f,g) | 1.0 if f is not equal to g, else 0.0 |
ne(f,g,v,w) | v if f is not equal to g, else w |
odd(f) | 1.0 if f odd, else 0.0 |
odd(f,v,w) | v if f odd, else w |
Other Functions | |
abs | absolute value |
between(f,g) | bring f between -g and g (modulo 2*g) |
entier | largest integer less than f |
exp | exponent |
gauss | GAUSS4+GAUSS1*exp(-0.5*((x-GAUSS2)/GAUSS3)**2) |
int | truncate |
log | natural log |
log10 | base 10 log |
max(f....) | maximum of (at most) 5 arguments |
min(f....) | minimum of (at most) 5 arguments |
mod(f,g) | f modulo g |
nint | round |
plog | natural log (zero for arg ≤ 1) |
plog10 | base 10 log (zero for arg ≤ 1) |
sign(f) | -1.0 if f<0, +1.0 if f≥0 |
sqrt | square root |
within(f,g,h) | f if g<f<h, otherwise the extreme value. min(max(f,g),h) |
Constants | |
Pi | 3.1415.... |
PiOver2 | 0.5*Pi |
TwoPi | 2*Pi |
Grad | 180.0/Pi |
rnd | 0.0-1.0 |
OutputLevel | Command | Action |
---|---|---|
full | @ | echo script name |
\command | list obsolete commands | |
\alias | echo alias definition | |
\repeat | echo repeat nr and command | |
\unalias | echo removal of alias | |
debug | a lot during file search | |
echo input and substituted lines |
Before | With Alias | Without Alias |
---|---|---|
abcd | [abcd] | abcd |
ab'cd | ab[cd] | abcd |
'abcd | [abcd] | abcd |
ab''cd | ab'cd | |
''abcd | 'abcd | |
ab'c'd | ab[c]d | abcd |
'ab'cd | [ab]cd | abcd |
abcd' | abcd |
alias | value |
---|---|
CONFIG_PATH | path where image configuration files reside |
IMAGE_NAME | name of current image |
USER_NAME | user invoking the program |
WORK_DIR | directory where program was started from |
NODE_NAME | host name |
PROCESS_MODE | Batch, Interactive..... |
PROCESS_NAME | process name or process id |
#make an alias script1 which executes a file \alias script1 @'config_path'script1 #if script2 exists, make an alias script2 \if file 'config_path'script2 \alias script2 @'config_path'script2 #so script2 will be an unknown command if the file does not exist #another approach: \alias script2 &'config_path'script2 #so script2 will be defined, but does nothing if the file does not exist. \alias x 600 \alias y 400 \alias w 1000 \alias h 800 \alias zoom2 zoomfactor 2 zoom 'hx'-'w'/4 'hy'-'h'/4 'hx'+'w'/4 'hy'+'h'/4 \alias zoom3 zoomfactor 3 zoom 'hx'-'w'/6 'hy'-'h'/6 'hx'+'w'/6 'hy'+'h'/6 \alias zoom4 zoomfactor 4 zoom 'hx'-'w'/8 'hy'-'h'/8 'hx'+'w'/8 'hy'+'h'/8 \alias zoom5 zoomfactor 5 zoom 'hx'-'w'/10 'hy'-'h'/10 'hx'+'w'/10 'hy'+'h'/10 \unalias w \unalias h \unalias x \unalias y #go5 will run go 5 times \alias go5 \repeat 5 go