A-Shell startup command line commands can also be assembled into a virtual command file, consisting of multiple commands separated by '\n'. For example:
ashw32.exe -e LOG BAS:\n:T\nJOBALC\nTIME\nEL -CFG
The above command line (after the -e) is equivalent to the following command file:
:R ; (this is automatic)
LOG BAS:
:T
JOBALC
TIME
EL -CFG
Note that the \n is case sensitive (must be lower). Also note that if using this technique under a Unix shell, you'll need to 'escape' the backslashes by preceding them with a backslash, i.e.:
ashell -e LOG BAS:\\n:T\\nJOBALC\\nTIME\\nEL -CFG
Notes
A-Shell attempts to analyze whether any \n characters occur in something that looks like a filespec. If so, it treats the \n as literal; else it treats it as a line break. For example:
xcall HOSTEX,"$ASHELL log ashtst:\nvue c:\notes \nsize c:\notes.txt"
The above command line contains 4 \n sequences. The first and third are considered not part of filespecs and thus are converted to line breaks. The second and fourth, which are contained in the token c:\notes.txt, which is interpreted as a filespec because it starts with what could be a drive letter.
Note the following tricks and considerations when trying to get "\n" to be treated as a line break:
• | If you want to follow a filespec with "\n", precede it by a space, as we did in the example above for the "\n" following "vue c:\notes". A trailing or leading space does not usually interfere with the interpretation of a filespec, so that shouldn't cause a problem. Without the space, in the example above, "c:\notes\nsize" would have been considered a single filespec. |
• | Quoting the filespec doesn't help, since the quotes are generally removed by the shell or other command line parser before we get to the code that looks for "\n". |
• | A token is considered to be a filespec if it starts with \\ or with a letter followed by a colon. |
History
2005 April, 4.9.927: Virtual command file handling added to A-Shell