UNIX Script Syntax

From Vital Soft Wiki
Revision as of 17:15, 8 July 2020 by >Johno (Created page with "On UNIX, the "-b" command line parameter is required so that AskPlus "knows" that it is running in batch. If this parameter is omitted, AskPlus will attempt to prompt the use...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

On UNIX, the "-b" command line parameter is required so that AskPlus "knows" that it is running in batch. If this parameter is omitted, AskPlus will attempt to prompt the user for input (for example when requesting permission to purge a file or when qualifying an ambiguous item) and will expect the next line of the script to contain a valid response. The most basic AskPlus run command is:

/ASKPLUS/askplus -b << EOD
open database;
find ...
report ...
exit
EOD

Other command line parameters, such as -aprofile, may also be specified prior to the "<<". The syntax << EOD syntax causes all the commands which follow (in the script) to be passed as input to the AskPlus program. All commands, up to the specified label (in this case EOD) will be passed to the program. By default, UNIX will perform $variable substitution before passing the input lines to AskPlus. If the label is enclosed in single quotes (<< 'EOD'), UNIX will not modify the lines in any way. If single quotes are not used, any AskPlus statement that uses a $ ($DATE or "$$$,$$9.99-") must be escaped with a '\' (back slash). For example \$DATE or "\$\$\$,\$\$9.99-". Script files generated by Visimage3 (File > Create UNIX Scipt File) will automatically escape all $ characters.