home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Complet / FreeDOS / fdbootcd.iso / FREEDOS / PACKAGES / BASE / DISK01 / COMMANDX.ZIP / HELP / FreeCom.EN < prev   
Text File  |  2003-12-11  |  102KB  |  3,118 lines

  1. FreeCom 0.82 patch level 3
  2.  
  3. List of commands and features of FreeCOM:
  4.  
  5.     * ALIAS - Display or change an alias <#alias>
  6.     * BEEP - Issue a Beep <#beep>
  7.     * BREAK - Display or Set Extended Break Checking <#break>
  8.     * CALL - Call a Nested Batchfile or Program <#call>
  9.     * CANCEL - Terminate all scripts <#cancel>
  10.     * CD - Change current directory of a drive <#cd>
  11.     * CDD - Changes the current working directory <#cdd>
  12.     * CHDIR - Change current directory of a drive <#chdir>
  13.     * CLS - Clear screen <#cls>
  14.     * COPY - Copy one or more files to another location <#copy>
  15.     * CTTY - Change TTY (console) <#ctty>
  16.     * DATE - Display or set current date <#date>
  17.     * DEL - Delete files <#del>
  18.     * DIR - Displays the contents of the directory <#dir>
  19.     * DIRS - Display the directory stack <#dirs>
  20.     * ECHO - Displays a string onto screen <#echo>
  21.     * ENVIRONMENT_KEEP_FREE - keep free space in environment segment
  22.       <#environment_keep_free>
  23.     * ERASE - Delete files <#erase>
  24.     * EXIT - Terminate shell <#exit>
  25.     * FEATURE_ALIASES - Command aliases <#feature_aliases>
  26.     * FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor
  27.       <#feature_auto_redirect_to_con>
  28.     * FEATURE_BATCH - Batch script processing <#feature_batch>
  29.     * FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is
  30.       present <#feature_boot_keys>
  31.     * FEATURE_CALL_LOGGING - Startup logging <#feature_call_logging>
  32.     * FEATURE_DIRSTACK - Directory stack <#feature_dirstack>
  33.     * FEATURE_ENHANCED_INPUT - Enhanced command line editing
  34.       <#feature_enhanced_input>
  35.     * FEATURE_FILENAME_COMPLETION - Filename completion
  36.       <#feature_filename_completion>
  37.     * FEATURE_HISTORY - Command line history <#feature_history>
  38.     * FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface
  39.       (MUX-AE) <#feature_installable_commands>
  40.     * FEATURE_LAST_DIR - Change back to last directory <#feature_last_dir>
  41.     * FEATURE_LOAD_MESSAGES - Load messages permanently
  42.       <#feature_load_messages>
  43.     * FEATURE_NLS - use DOS NLS <#feature_nls>
  44.     * FOR - Repeat a command <#for>
  45.     * GOTO - Goto label <#goto>
  46.     * HISTORY - Display command line history <#history>
  47.     * IF - Conditional execution of a command <#if>
  48.     * LOADFIX - Load an external program above the first 64KB memory
  49.       <#loadfix>
  50.     * LOADHIGH - Load an external program into high memory <#loadhigh>
  51.     * MD - make directory <#md>
  52.     * MEMORY - Display the internally used memory <#memory>
  53.     * MKDIR - Make directory <#mkdir>
  54.     * PATH - Display or set the search path <#path>
  55.     * PAUSE - Pauses batch file execution <#pause>
  56.     * POPD - Change back to the last pushed directory <#popd>
  57.     * PROMPT - Display or set the shell prompt <#prompt>
  58.     * PUSHD - Push the current working directory onto the directory
  59.       stack <#pushd>
  60.     * QUIT - Terminate the current script <#quit>
  61.     * RD - Remove directory <#rd>
  62.     * REM - Marks comments or remarks in batchfiles <#rem>
  63.     * REN - Rename files <#ren>
  64.     * RENAME - Rename files <#rename>
  65.     * RMDIR - Remove directory <#rmdir>
  66.     * SET - Display or set environment variables <#set>
  67.     * SHIFT - Shift the arguments of a batch script <#shift>
  68.     * TIME - Display or set current time <#time>
  69.     * TRUENAME - Display the true name of a file <#truename>
  70.     * TYPE - Display the contents of files <#type>
  71.     * VER - Display the version information about FreeCOM and DOS <#ver>
  72.     * VERIFY - Display or set verify level <#verify>
  73.     * VOL - Display the volume label of a drive <#vol>
  74.     * WHICH - Search and display the executable file of specified
  75.       commands <#which> 
  76.  
  77.  
  78.  
  79. ------------------------------------------------------------------------
  80.  
  81.  
  82.     ALIAS - Display or change an alias
  83.  
  84. Requirements: FEATURE_ALIASES <#feature_aliases>
  85.  
  86.  
  87.       Synopsis
  88.  
  89.    1. ALIAS
  90.    2. ALIAS /name/ '=' *[* ½string╗ *]*
  91.  
  92. The first format without any argument displays all defined aliases.
  93.  
  94. The second format assigns the specified /string/ to the alias with the
  95. specified /name/. If the /string/ is empty, the named alias is removed.
  96.  
  97. Once an aliase is defined, a command line of the form: name { argument }
  98. is replaced by: <> { argument }
  99. This mechanism is called /alias expansion/, because the alias /name/
  100. expands to the specified ½string╗. To prevent alias expansion the
  101. command must be prefixed by one asterisk, e.g.: *name arguments
  102.  
  103.  
  104.       Examples
  105.  
  106.  
  107.         Example: 1
  108.  
  109. ALIAS <#alias> dir=dir /w
  110. dir
  111. displays short directory listing from now on.
  112.  
  113.  
  114.         Example: 2
  115.  
  116. ALIAS <#alias>
  117. displays all currently defined aliases, e.g.:
  118.  
  119. DIR <#dir>=dir /w
  120.  
  121. in this case.
  122.  
  123.  
  124.         Example: 3
  125.  
  126. ALIAS <#alias> dir=
  127. removes the previously defined alias dir, thus, DIR <#dir> displays the
  128. long output as by default again.
  129.  
  130. ------------------------------------------------------------------------
  131.  
  132.  
  133.     FEATURE_ALIASES - Command aliases
  134.  
  135. See also: ALIAS <#alias>
  136.  
  137. If defined on compilation of FreeCOM, command aliases are supported.
  138.  
  139. New aliases are _defined_ using the command:
  140. ALIAS /name/ '=' ½string╗
  141.  
  142. Aliases are _removed_ using the command:
  143. ALIAS /name/ '='
  144.  
  145. When FreeCOM is interpreting a command line, the command -- the very
  146. first word -- is matched against all defined aliases. This word is
  147. separated from its arguments by whitespaces and cannot contain any path
  148. delimiters, such as backslashes or colons.
  149. If the command matches an alias, the name is _substituted_ by the
  150. ½string╗associated to the aliases, e.g. by defining the alias ls by:
  151. ALIAS <#alias> ls=dir /w/o
  152.  
  153. let FreeCOM interprete the command line:
  154. C> ls /a
  155.  
  156. exactly as if one had typed in:
  157. C> dir /w/o /a
  158.  
  159. To _prevent_ the alias expansion an asterisk is prefixed before the
  160. command, e.g.:
  161. C> *ls /a
  162.  
  163. really tries to execute the command:
  164. ls /a
  165.  
  166. which usually is an external command.
  167.  
  168. Aliases may be used to _hide or re-place internal commands_, e.g.:
  169. ALIAS <#alias> dir=xdir
  170.  
  171. effectively hides the internal command DIR <#dir> and will always
  172. execute the -- usually -- external command XDIR.
  173.  
  174. Aliases _may be nested_, so if both alias definitions mentioned above
  175. are in place, the command:
  176. C> ls /a
  177.  
  178. is really executed as:
  179. xdir /w/o /a
  180.  
  181. where the ls command is substituted by the command dir /w/o, then dir is
  182. detected as alias, too, and hence replaced by xdir.
  183. The same alias is _never substituted twice_, neither directly nor
  184. transitively, so:
  185. ALIAS <#alias> dir=dir /w
  186.  
  187. is allowed as well as:
  188. ALIAS <#alias> ls=dir /w/o
  189. ALIAS <#alias> dir=ls -l
  190.  
  191. command results in
  192. ls ls -l /w/o
  193. dir dir /w/o -l
  194.  
  195. As implied above, aliases are expanded when needed and /not/ when they
  196. are defined.
  197.  
  198. Aliases are storred _for each instance of FreeCOM individually_ and are
  199. inherited by secondary instances from the parent.
  200.  
  201.  
  202.       Options
  203.  
  204. Compile-time options:
  205.  
  206.     * ALIAS_DEFAULT_SIZE: The size reserved for all aliases per FreeCOM
  207.       instance. Default: 1024 
  208.  
  209. ------------------------------------------------------------------------
  210.  
  211.  
  212.     BEEP - Issue a Beep
  213.  
  214. Requirements: CMD_BEEP
  215.  
  216.  
  217.       Synopsis
  218.  
  219. BEEP
  220.  
  221. Issues a beep.
  222. At this time FreeCOM supports audible beeps only.
  223.  
  224. ------------------------------------------------------------------------
  225.  
  226.  
  227.     BREAK - Display or Set Extended Break Checking
  228.  
  229. Requirements: CMD_BREAK
  230.  
  231.  
  232.       Synopsis
  233.  
  234. BREAK *[* ON | OFF *]*
  235.  
  236. Displays or sets the Extended Break status.
  237.  
  238. By pressing ^Break or ^C (Control-Break or Control-C) an user may signal
  239. the currently running program to halt. Most programs will abort to the
  240. prompt, but some may decide to just cancel the current action, but
  241. remain active.
  242.  
  243. DOS checks for ^Break/^C (Control-Break or Crontrol-C) each time a
  244. program issues a console input/output request. When Extended Break
  245. checking is enabled (/ON/), DOS checks for ^Break each time a program
  246. issues a request.
  247.  
  248. ------------------------------------------------------------------------
  249.  
  250.  
  251.     CALL - Call a Nested Batchfile or Program
  252.  
  253. See also: LOADFIX <#loadfix>, LOADHIGH <#loadhigh>
  254. Optional requirements: FEATURE_KERNEL_SWAP_SHELL
  255.  
  256.  
  257.       Synopsis
  258.  
  259.    1. CALL *[/Y]* /program/ *[* ½arguments╗ *]*
  260.    2. CALL *[/Y]* *[* */S* | */N* *]* /program/ *[* ½arguments╗ *]*
  261.  
  262. Calls a program or batch script.
  263.  
  264. If the /program/ is a batch script <#_appendix_batch>, that means it has
  265. the extension .BAT, CALL <#call> nests the batch script within the
  266. already running one. Without CALL <#call> the invoked batch script would
  267. terminate all already running batch scripts.
  268.  
  269. If present, the arguments are passed unchanged to the invoked program.
  270.  
  271.  
  272.       Options
  273.  
  274. Unless stated otherwise all options of this command do follow the
  275. standard rules for options <#_appendix_options>.
  276.  
  277.     * */S*: If /program/ is not a batch script, the external program is
  278.       executed by swapping FreeCOM out of memory. This process will
  279.       require more time, especially if FreeCOM is to be reloaded from a
  280.       floppy, some internal settings are lost, e.g. command line
  281.       history, but it will free as much memory as possible for the
  282.       external program.
  283.  
  284.       This option and, thereby, this function is available only, if
  285.       FreeCOM had been compiled with some support for swapping.
  286.  
  287.     * */N*: If /program/ is not a batch script, the external program is
  288.       executed directly, with swapping disabled. */N* superceeds */S*.
  289.     * */Y*: Enables tracemode during execution of the command. 
  290.  
  291. Note: In the future to swap FreeCOM out of memory during the execution
  292. of an external program will be the default behaviour.
  293.  
  294. ------------------------------------------------------------------------
  295.  
  296.  
  297.     CANCEL - Terminate all scripts
  298.  
  299.  
  300.       Synopsis
  301.  
  302. CANCEL *[* /n/ *]*
  303. Terminates all currently active batch scripts and, if present, assigns
  304. the specified number /n/ to the errorlevel.
  305.  
  306. /Note/: This command is a hidden internal command <#_appendix_hicmd>.
  307.  
  308. ------------------------------------------------------------------------
  309.  
  310.  
  311.     CD - Change current directory of a drive
  312.  
  313. See also: CDD <#cdd>, CHDIR <#chdir>, DIR <#dir>, DIRS <#dirs>, MD
  314. <#md>, PUSHD <#pushd>, RD <#rd>
  315. Requirements: CMD_CHDIR
  316. Optional requirements: FEATURE_LAST_DIR <#feature_last_dir>
  317.  
  318.  
  319.       Synopsis
  320.  
  321.    1. CD
  322.    2. CD *[* /drive/ ':' *]* /path/
  323.    3. CD '-'
  324.  
  325. CD <#cd> is 100% compatible with the CHDIR <#chdir> command; there is no
  326. difference -- beside the spelling -- between them.
  327.  
  328. The first variant shows the current working directory <#_appendix_cwd>
  329. as absolute path.
  330.  
  331. The second variant changes the current directory <#_appendix_currdir> of
  332. the given drive. If no drive is specified on command line, the current
  333. directory of the currently selected drive (disk) <#chgdrive> is changed.
  334. This command does *not* change the currently selected drive in opposite
  335. to CDD <#cdd>!
  336.  
  337. The third variant changes back into the last visited directory *and*
  338. drive. The commands CD <#cd>, CHDIR <#chdir>, CDD <#cdd>, and PUSHD
  339. <#pushd> save the current working directory before performing the
  340. specified directory change; the command CD <#cd> '-' restores this saved
  341. directory. This command is available only, if the feature LAST_DIR has
  342. been enabled during the compilation of FreeCOM.
  343.  
  344.  
  345.       Options
  346.  
  347. There are no options for this command.
  348.  
  349.  
  350.       Examples
  351.  
  352.  
  353.         Example: 1
  354.  
  355. CD <#cd> \freedos\help
  356. Changes the current working directory of the currently selected drive to
  357. the path \FREEDOS\HELP.
  358.  
  359.  
  360.         Example: 2
  361.  
  362. CD <#cd> c:\freedos\help
  363. Changes the current directory of drive C:.
  364.  
  365.  
  366.         Example: 3
  367.  
  368. Assuming the current working directory is \FREEDOS\HELP and the
  369. currently selected drive is C:. CD <#cd>
  370. Displays C:\FREEDOS\HELP
  371.  
  372.  
  373.         Example: 3
  374.  
  375. The command sequence, provided the first two worked successfully:
  376. CD <#cd> \FREEDOS\HELP
  377. CD <#cd> ..
  378. CD <#cd> -
  379. changes first into the directory \FREEDOS\HELP, then into its parent
  380. directory, which is \FREECOM. And finally CD <#cd> - changes back to
  381. \FREEDOS\HELP, because this was the previous directory before previous
  382. CD <#cd>-like command.
  383.  
  384. Because CD <#cd> - saves the previous directory, too, any subsequent: CD
  385. <#cd> -
  386. will switch between these two directories; until another directory is
  387. changed to.
  388.  
  389. ------------------------------------------------------------------------
  390.  
  391.  
  392.     CDD - Changes the current working directory
  393.  
  394. See also: CD <#cd>, DIR <#dir>, MD <#md>, PUSHD <#pushd>, RD <#rd>
  395. Requirements: CMD_CDD
  396.  
  397.  
  398.       Synopsis
  399.  
  400.    1. CDD
  401.    2. CDD *[* /drive/ ':' *]* /path/
  402.    3. CDD '-'
  403.  
  404. The behaviour of CDD <#cdd> is similiar to the CD <#cd> command, but it
  405. always changes both the currently selected drive and the current
  406. directory, thus, it changes the current working directory.
  407.  
  408. For further details please see the CD <#cd> command.
  409.  
  410. ------------------------------------------------------------------------
  411.  
  412.  
  413.     CHDIR - Change current directory of a drive
  414.  
  415. This command is 100% compatible to CD <#cd>, please see there
  416.  
  417. ------------------------------------------------------------------------
  418.  
  419.  
  420.     CLS - Clear screen
  421.  
  422. See also: ECHO <#echo>, TYPE <#type>
  423. Requirements: CMD_CLS
  424.  
  425.  
  426.       Synopsis
  427.  
  428. CLS
  429. Clears the screen and resets the character colours to white on black.
  430.  
  431. ------------------------------------------------------------------------
  432.  
  433.  
  434.     COPY - Copy one or more files to another location
  435.  
  436. See also: DEL <#del>, REN <#ren>
  437. Requirements: CMD_COPY
  438.  
  439.  
  440.       Synopsis
  441.  
  442.    1. COPY *[{* /option/ *}]* /source/ *[{* /option/ *}]* /target/ *[{*
  443.       /option/ *}]*
  444.  
  445. Copies the source file into the target file. See also: \REF{wildcards}
  446.  
  447. Before parsing its command line COPY <#copy> parses any /option/
  448. specified by the environment variable *COPYCMD*.
  449.  
  450.  
  451.       Options
  452.  
  453. Unless stated otherwise all options of this command do follow the
  454. standard rules for options <#_appendix_options>.
  455.  
  456.     * */A* see below
  457.     * */B*: Specifies the mode, in which the file is copied, */A* forces
  458.       ASCII and */B* forces binary mode.
  459.  
  460.       These options do alter the mode of the file immediately preceeding
  461.       them and all following ones, until changed again.
  462.  
  463.       In binary mode the file is copied and nothing is changed at all.
  464.  
  465.       In ASCII mode COPY <#copy> takes special care about linefeeds /
  466.       newline characters and the end-of-line character.
  467.  
  468.           o On read, the newline characters, which are a sequence of two
  469.             different bytes in DOS, are transformed into a single
  470.             character, as known from Unix-style systems. On write, this
  471.             single character is transformed into the two-byte sequence.
  472.             So, if both files are copied with different modes, newline
  473.             characters are transformed into either way.
  474.           o If the end-of-file character is found on read, the remaining
  475.             contents of the file is ignored. On write, such character is
  476.             appended after the last character has been written. 
  477.       By default, files are copied in binary mode, whereas devices, e.g.
  478.       CON:, are copied in ASCII mode, but no end-of-file is appended. 
  479.  
  480.  
  481.       Arguments
  482.  
  483.     * /source/: The source file.
  484.       If more than one source file is specified, the target must be a
  485.       directory.
  486.     * /target/: The target of the COPY <#copy> process.
  487.       If target is a directory, the destination file is placed into this
  488.       directory, but with the same filename as the source file.
  489.       If exactly one source is specified, but no target, target defaults
  490.       to just ., which represant the current directory. 
  491.  
  492. ------------------------------------------------------------------------
  493.  
  494.  
  495.     CTTY - Change TTY (console)
  496.  
  497. Requirements: CMD_CTTY
  498.  
  499.  
  500.       Synopsis
  501.  
  502. CTTY /device/
  503. With this command the console device can be changed. A console device
  504. performs all basic input and output operations. This change is more
  505. complete than IO-redirections <#_appendix_redirection>, because latter
  506. one might not catch all output, for instance the error messages. See
  507. example 3 below.
  508. Because the console is a bidirectional virtual device, meaning it is to
  509. perform input *and* output, the specified /device/ must not a
  510. unidirectional device, such as PRN.
  511.  
  512. To specify a second argument on the command line of FreeCOM has the same
  513. effect.
  514.  
  515. *Attention*: This command is to effect the whole system, not only
  516. FreeCOM itself; so the effect of CTTY <#ctty> does not only depend on
  517. the implementation status of FreeCOM, but on the DOS kernel, too.
  518.  
  519. Also, some programs access the screen or keyboard directly, rather than
  520. using the DOS functions; these programs are *not* effected by CTTY <#ctty>.
  521.  
  522.  
  523.       Examples
  524.  
  525.  
  526.         Example: 1
  527.  
  528. CTTY <#ctty> aux
  529. Changes the console to the /AUX:/ device, which is usually the first
  530. serial communication port COM1:. If this line is connected to a terminal
  531. or a terminal emulator, the system can be controlled from the terminal
  532. by now.
  533.  
  534.  
  535.         Example: 2
  536.  
  537. CTTY <#ctty> nul
  538. any command sequence
  539. CTTY <#ctty> con
  540. The first command discards any output. If a program attempts any input
  541. operation, it gets none. Some programs may not handle such situation
  542. correctly.
  543. So, any output, even error messages, are discarded during the command
  544. sequence.
  545. The second command changes the console back to the screen/keyboard pair.
  546. To display a string onto screen or read from keybord the usual
  547. I/O-redirections <#_appendix_redirection> may be used, for instance:
  548.  
  549.     * ECHO <#echo> This line appears on the screen >CON
  550.     * PAUSE <#pause> <CON
  551.       This PAUSE <#pause> command will get its input even within the
  552.       "CTTY <#ctty> nul" environment. 
  553.  
  554. ------------------------------------------------------------------------
  555.  
  556.  
  557.     DATE - Display or set current date
  558.  
  559. See also: TIME <#time>
  560. Requirements: CMD_DATE
  561.  
  562.  
  563.       Synopsis
  564.  
  565.    1. DATE *[* */D* *]*
  566.    2. DATE *[* */D* *]* /date/
  567.  
  568. The first variant displays the current system date, then enters a loop
  569. prompting the user for a new date. The loop terminates, if the user
  570. entered a valid new date or just pressed the ENTER key.
  571.  
  572. The second variant does not display the current date and tries to change
  573. the date to the specified /date/. On success the command terminates,
  574. otherwise enters the loop explained above.
  575.  
  576. The individual portions of a date may be separated by at least: dots .,
  577. forward slashes / or dashes -. Other nationally used characters may be
  578. supported, too.
  579. DATE <#date> will support partial formats:
  580.  
  581.     * A /single numnber/: specifies the day only.
  582.     * /Two numbers/: specifies the day and the month in the order used
  583.       by the national date format, which is MM/DD for American and
  584.       Japanese and DD/MM for European format.
  585.     * /Three numbers/: specifies a full date including day, month and
  586.       year in the order suitable for the national date format, which is:
  587.           o MM/DD/[CC]YY: for American,
  588.           o DD/MM/[CC]YY: for European and
  589.           o [CC]YY/MM/DD: for Japanese format. 
  590.       If the year portion is less than 100, the century is assumed to be
  591.       1900, if it is greater or equal than 80; otherwise the century is
  592.       2000.
  593.  
  594.       /Note/: Some European countries introduced the so-called business
  595.       date in 1996 or so, which is the same as the Japanese format; it
  596.       makes sorting of literal dates a lot easier. If FreeCOM will or
  597.       will not support it, will depend on the NLS used by DOS.
  598.  
  599.  
  600. Symbolical names of monthes are not support (yet).
  601.  
  602.  
  603.       Options
  604.  
  605. All options must precced any argument.
  606.  
  607. */D* prevents from prompting the user.
  608.  
  609.    1. In variant 1, the date is displayed only.
  610.    2. In variant 2, the date is tried to be changed, but the loop is not
  611.       entered on failure. 
  612.  
  613.  
  614.       Examples
  615.  
  616.  
  617.         Example: 1
  618.  
  619. DATE <#date> /D
  620. Just display the current system date.
  621.  
  622.  
  623.         Example: 3
  624.  
  625. DATE <#date> 2/1/00
  626. Sets the current date to 1st February of 2000.
  627.  
  628. ------------------------------------------------------------------------
  629.  
  630.  
  631.     DEL - Delete files
  632.  
  633. See also: DIR <#dir>
  634. Requirements: CMD_DELETE
  635.  
  636.  
  637.       Synopsis
  638.  
  639. DEL *[{* /options/ | /pattern/ *}]*
  640. Deletes files, if /pattern/ matches a directory, all files within this
  641. directory are deleted.
  642.  
  643. When all files are to be deleted, a warning prompt is issued.
  644.  
  645.  
  646.       Options
  647.  
  648. Unless stated otherwise all options of this command do follow the
  649. standard rules for options <#_appendix_options>.
  650.  
  651.     * */P*: Prompts the user before delete a file.
  652.     * */V*: Displays, which files are deleted. 
  653.  
  654.  
  655.       Examples
  656.  
  657.  
  658.         Example: 1
  659.  
  660. DEL <#del> FILE1.EXT FILE2.EXT
  661. Deletes the files FILE1.EXT and FILE2.EXT.
  662.  
  663.  
  664.         Example: 2
  665.  
  666. DEL <#del> /P *.bak
  667. Deletes all files with extension BAK, but prompts the user for each
  668. single file before deleting it.
  669.  
  670.  
  671.         Example: 3
  672.  
  673. DEL <#del>.
  674. Deletes all files within the current directory.
  675.  
  676. ------------------------------------------------------------------------
  677.  
  678.  
  679.     DIR - Displays the contents of the directory
  680.  
  681. See also: CHDIR <#chdir>, MKDIR <#mkdir>, RMDIR <#rmdir>
  682. Requirements: CMD_DIR
  683.  
  684.  
  685.       Synopsis
  686.  
  687. DIR *[{* /options/ | /pattern/ *}]*
  688.  
  689. DIR <#dir> displays the contents of direcories and/or the attributes of
  690. files, whatever the /pattern/ specifies. If no /pattern/ is specified on
  691. command line, the current working directory is displayed. The actual
  692. information displayed depends on the specified options and is explained
  693. below.
  694.  
  695. A /pattern/ may contain wildcards <#_appendix_wildcards>, which are
  696. expanded against both files and directories. To specify a directory is
  697. essentially equal to write: directory\*.*.
  698.  
  699. Unlike options patterns are performed in sequence, that means that if
  700. two patterns are specified, first all entries matching the first one,
  701. then all entries matching the second one are displayed; instead of to
  702. display the matching entries intermixed.
  703.  
  704. Before parsing its command line DIR <#dir> parses any /option/ specified
  705. by the environment variable *DIRCMD*.
  706.  
  707.  
  708.       Options
  709.  
  710. Unless stated otherwise all options of this command do follow the
  711. standard rules for options <#_appendix_options>.
  712.  
  713.     * */A*: (All) Wildcards are matched against System and Hidden files,
  714.       too.
  715.     * */A***: (Attribute) Wildcards are matched against files with
  716.       selected attributes set or clear. The argument of the */A* option
  717.       is a sequence of:
  718.           o *?* meaning: attribute *?* must be set, or
  719.           o *-?* meaning: attribute *?* must not be set. 
  720.  
  721.       The following attributes, the *?* above, are supported:
  722.  
  723.           o *R* for: read-only,
  724.           o *H* for: hidden,
  725.           o *S* for: system,
  726.           o *D* for: directory, and
  727.           o *A* for: archive. 
  728.  
  729.       If the same attribute is specified twice within the same */A*
  730.       option, the last one superceeds previous ones; if more than one
  731.       */A* option is specified, the last one superceeds all previous ones.
  732.  
  733.     * */B*: (Bare) Displays the lines with the information of files and
  734.       directories only. The ones displaying the volume label, the serial
  735.       number, totals etc. are suppressed. In combination with */S* the
  736.       absolute path of the files is displayed.
  737.     * */L*: (Lower-case) Filenames are displayed in lower-case letters
  738.       rather than capitol ones.
  739.     * */O*: (Order default) is a synonym of */ONG*.
  740.     * */O***: (Order) Sort the entries displayed in a specific order.
  741.       The following sort orders are supported:
  742.           o *D* sort by last modification *d*ate (earliest first)
  743.           o *E* sort by file *e*xtension
  744.           o *G* *g*roup directories first
  745.           o *N* sort by file *n*ame
  746.           o *S* sort by size (smallest first)
  747.           o *U* do not sort (*u*nsorted) 
  748.  
  749.       Each sort order, except *U*, may be prefixed by a hyphen to
  750.       reverse the sort order. *U* effectively cancels any previous
  751.       setting or specified sort order, e.g. to override an */O* option
  752.       from the *DIRCMD* environment variable.
  753.  
  754.       If the same sort order is specified twice within the same */O*
  755.       option, the last one superceeds previous ones; if more than one
  756.       */O* option is specified, the last one superceeds all previous ones.
  757.  
  758.       *Warning*: The entries are cached within memory before displaying
  759.       them; if FreeCOM runs short on memory, to sort is disabled
  760.       completely or the entries are sorted in chunks only.
  761.  
  762.     * */P*: (Page) Page the output -- pause the display after issuing
  763.       one screen-full.
  764.     * */S*: (Subdirectories) Recursively display directories.
  765.     * */W*: (Wide) Displays five filenames per line and suppress the
  766.       information about the file size, date etc.
  767.     * */Y*: (Year) Displays a 4-digit year, rather than just two digits.
  768.     * */4*: (4digit Year) is a synonym of */Y*. 
  769.  
  770.  
  771.       Examples
  772.  
  773.  
  774.         Example: 1
  775.  
  776. DIR <#dir>
  777. Displays the contents of the current directory, but ignore System and
  778. Hidden files. The output may look like this:
  779.  
  780. !!todo!!
  781.  
  782.  
  783.         Example: 2
  784.  
  785. DIR <#dir> a* bb* *.txt
  786. First displays all files, that begin with the letter A; then all files,
  787. that begin with two letters B, are displayed and at last all files with
  788. the extension TXT.
  789.  
  790.  
  791.         Example: 3
  792.  
  793. DIR <#dir> /w a* b*
  794. DIR <#dir> a* /w b*
  795. DIR <#dir> a* b* /w
  796. Because the position of options is not significant, all these examples
  797. behave the same way and display the matching files in /wide/ or also
  798. called /short/ form, which may look like this:
  799.  
  800. !!todo!!
  801.  
  802. ------------------------------------------------------------------------
  803.  
  804.  
  805.     DIRS - Display the directory stack
  806.  
  807. See also: CD <#cd>, CHDIR <#chdir>, POPD <#popd>, PUSHD <#pushd>
  808. Requirements: CMD_DIRS
  809.  
  810.  
  811.       Synopsis
  812.  
  813. DIRS
  814. Displays all directories stacked with the PUSHD <#pushd> command.
  815.  
  816. ------------------------------------------------------------------------
  817.  
  818.  
  819.     ECHO - Displays a string onto screen
  820.  
  821. See also: TYPE <#type>
  822. Requirements: CMD_ECHO
  823.  
  824.  
  825.       Synopsis
  826.  
  827.    1. ECHO *[* ON | OFF *]*
  828.    2. ECHO ½string╗
  829.    3. ECHO.
  830.  
  831. When executing a batch script each line is displayed to the console
  832. before executing it by default. The first variant of ECHO <#echo>
  833. enables or disables this behaviour. To disable echoing the commands is
  834. equal to prefix each line of a batch script with the Ad-symbol @.
  835. If ECHO <#echo> is invoked with no argument at all, the current echo
  836. status is displayed.
  837. When entered on an interactive command line the echo status controls
  838. whether or not the PROMPT <#prompt> string is displayed.
  839.  
  840. The second variant displays the specified ½string╗.
  841. Note: Because of variant 1 ½string╗ may not expand to the single words
  842. ON or OFF without another character.
  843.  
  844. The third variant displays an empty line. No space must be placed
  845. between the dot and ECHO <#echo>.
  846.  
  847.  
  848.       Examples
  849.  
  850.  
  851.         Example: 1
  852.  
  853. ECHO <#echo>
  854. Displays the current echo status, e.g. responding:
  855.  
  856. ECHO <#echo> is on
  857.  
  858.  
  859.         Example: 2
  860.  
  861. @ECHO <#echo> OFF
  862. Disables the echo status. Because the Ad-sign @ disables the echo status
  863. right for this line, this command disable echoing all the next lines of
  864. a batch script and is not echoed to the console itself. It is,
  865. therefore, best placed in the first line of a batch script.
  866.  
  867.  
  868.         Example: 3
  869.  
  870. ECHO <#echo> Just a text
  871. Displays Just a text
  872.  
  873. ------------------------------------------------------------------------
  874.  
  875.  
  876.     FEATURE_ENHANCED_INPUT - Enhanced command line editing
  877.  
  878. See also: FEATURE_FILENAME_COMPLETION <#feature_filename_completion>,
  879. FEATURE_HISTORY <#feature_history>
  880.  
  881. If enabled on compilation of FreeCOM, enhanced command line editing
  882. features are activated. Otherwise, FreeCOM uses the default buffered
  883. input DOS API function #0A.
  884.  
  885. If this feature is disabled, neither command line history nor filename
  886. completion is available.
  887.  
  888. Besides the other features various key bindings recognized, which are
  889. listed in the general FreeCOM documentation.
  890.  
  891. ------------------------------------------------------------------------
  892.  
  893.  
  894.     ERASE - Delete files
  895.  
  896. This command is 100% compatible to DEL <#del>, please see there
  897.  
  898. ------------------------------------------------------------------------
  899.  
  900.  
  901.     EXIT - Terminate shell
  902.  
  903.  
  904.       Synopsis
  905.  
  906. EXIT
  907. Terminates the currently running shell, unless FreeCOM had been started
  908. with the */P* option. In this case, EXIT <#exit> works like CANCEL
  909. <#cancel>.
  910.  
  911. ------------------------------------------------------------------------
  912.  
  913.  
  914.     FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor
  915.  
  916. If defined on compilation of FreeCOM and if FreeCOM is to terminate
  917. although it is forbidden -- e.g. by passing the */P* option when
  918. executing FreeCOM --, the console is changed to the keyboard/monitor
  919. pair automatically after some insuccessful prompts to reboot the system.
  920.  
  921.  
  922.       Options
  923.  
  924. Compile-time options:
  925.  
  926.     * FEATURE_AUTO_REDIRECT_TO_CON <#feature_auto_redirect_to_con>: How
  927.       many loops may pass before switching the console CON: to the
  928.       monitor. Default: 5. 
  929.  
  930. ------------------------------------------------------------------------
  931.  
  932.  
  933.     FEATURE_BATCH - Batch script processing
  934.  
  935. Requirements: IMPLICIT
  936.  
  937. The batch script processing is always enabled.
  938.  
  939.  
  940.       Options
  941.  
  942. Compile-time options:
  943.  
  944.     * BATCH_NESTLEVEL_MIN: Minimal supported batch nesting level.
  945.       Default: 5 
  946.  
  947. ------------------------------------------------------------------------
  948.  
  949.  
  950.     ENVIRONMENT_KEEP_FREE - keep free space in environment segment
  951.  
  952. If defined on compilation of FreeCOM, FreeCOM tries to keep the unused
  953. space in the environment segment equal to or greater than
  954. ENVIRONMENT_KEEP_FREE <#environment_keep_free>. The default value is 256.
  955.  
  956. ------------------------------------------------------------------------
  957.  
  958.  
  959.     FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is present
  960.  
  961. If defined on compilation of FreeCOM, FreeCOM waits three seconds on
  962. startup, if the */P* switch is present. If during this time a key has
  963. been pressed, |F5| will bypass AUTOEXEC.BAT execution and |F8| will
  964. enable trace mode.
  965. |F5| is equal to to pass the */D* switch <FreeCOM.html#-cmdline> to
  966. FreeCOM.
  967. |F8| is equal to to pass the */Y* switch <FreeCOM.html#-cmdline> to
  968. FreeCOM.
  969.  
  970. ------------------------------------------------------------------------
  971.  
  972.  
  973.     FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface (MUX-AE)
  974.  
  975. If defined on compilation of FreeCOM, calls to the Installable Commands
  976. API are made before executing any command. The API is situated at
  977. MUX-AE, the Multiplexer interrupt 0x2F function 0xAE.
  978.  
  979. The interface is documented elsewhere, for instance RBIL (Ralph Brown's
  980. interrupt list).
  981.  
  982. ------------------------------------------------------------------------
  983.  
  984.  
  985.     FEATURE_NLS - use DOS NLS
  986.  
  987. If defined on compilation of FreeCOM, FreeCOM uses the information
  988. retrievable by the currently active DOS NLS using the API functions #65.
  989.  
  990. These information influence:
  991.  
  992.     * the format displaying time and date information,
  993.     * the characters to delimit items in lists,
  994.     * the currency string and display format,
  995.     * how to up- (and supported by some NLS only) to lower-case characters,
  996.     * how to sort characters. 
  997.  
  998. ------------------------------------------------------------------------
  999.  
  1000.  
  1001.     FEATURE_CALL_LOGGING - Startup logging
  1002.  
  1003. If defined on compilation of FreeCOM, all startups of a FreeCOM instance
  1004. is logged into a file.
  1005.  
  1006. The drive the logfile is created on can be changed at run-time with the
  1007. external tool PTCHLDRV.
  1008.  
  1009.  
  1010.       Options
  1011.  
  1012. Compile-time options:
  1013.  
  1014.     * LOG_FILE: The name of the logfile. Default: C:\FreeCom.log 
  1015.  
  1016. ------------------------------------------------------------------------
  1017.  
  1018.  
  1019.     FEATURE_FILENAME_COMPLETION - Filename completion
  1020.  
  1021. Requirements: FEATURE_ENHANCED_INPUT <#feature_enhanced_input>
  1022.  
  1023. If defined on compilation of FreeCOM and if the enhanced command line
  1024. editing is activated as well, the tabulatur key binding becomes available.
  1025.  
  1026. When the tabulator key is pressed, the word the cursor is located on
  1027. actually or is immediately preceeding is separated and tried to match
  1028. against files, like a DIR <#dir> command would do, e.g. when hitting tab
  1029. at the command line:
  1030. bar\f_ some arguments
  1031.  
  1032. -- where the underscore _ is to mark the location of the cursor and is
  1033. /no/ actual character -- causes FreeCOM to try to locate any files or
  1034. directories matching the filename pattern bar\f*.*.
  1035. If none is found, a beep is issued to indicate that error and the
  1036. command line remains unchanged.
  1037. Otherwise as many characters are appended to the filename as are the
  1038. same for all found matches, e.g.:
  1039.  
  1040.    1. if exactly one match was found, its name is appened.
  1041.    2. if, for example, the files or directories: FOO, FUU.TXT or FUU are
  1042.       present in the directory BAR, no character is appened, because
  1043.       there are no equal characters following the already present f
  1044.       character.
  1045.    3. if, for example, the files or directories: FOO, FOO.TXT or
  1046.       FOO1.TXT are present in the directory BAR, the two characters OO
  1047.       are appened, because all found matches share these two characters
  1048.       immediately following the already present characers. Hence, the
  1049.       command line is expanded to:
  1050.       bar\FOO_ some arguments
  1051.  
  1052.       Please note that the case of all characters will match the case of
  1053.       the retrieved filenames. 
  1054.  
  1055. In addition, because in the cases 2 and 3 the file completion was not
  1056. complete because more than one match was found, a beep is issued. In
  1057. this situation to hit the tabulator key a second time, without an
  1058. intervueing other key press, causes to display all available matches,
  1059. but keeps the command line unchanged otherwise.
  1060. If exactly one filename match was found, hence the file completion was
  1061. complete, and if the found match is a directory, a backslash is appended
  1062. to. This allows to walk into deep levels of directories speededly.
  1063.  
  1064. If the cursor had been placed, for instance, under the backslash in
  1065. above mentioned command line, the full string bar\f had been tried to be
  1066. completed as well. This behaviour differs from other implementations.
  1067.  
  1068.  
  1069.       Options
  1070.  
  1071. Compile-time options:
  1072.  
  1073.     * FILE_SEARCH_MODE: Filemode passed to the DOS API to aquire
  1074.       matching directory entries. Default: Read-Only, Archive, Directory 
  1075.  
  1076. ------------------------------------------------------------------------
  1077.  
  1078.  
  1079.     FEATURE_DIRSTACK - Directory stack
  1080.  
  1081. See also: DIRS <#dirs>, POPD <#popd>, PUSHD <#pushd>
  1082.  
  1083. This feature is automatically enabled, if PUSHD <#pushd> is enabled.
  1084.  
  1085. The directory stack pushes and pops directories on demand via the
  1086. commands PUSHD <#pushd> and POPD <#popd>. DIRS <#dirs> displays all
  1087. pushed directories.
  1088.  
  1089. Please see the documentation of the mentioned commands.
  1090.  
  1091.  
  1092.       Options
  1093.  
  1094. Compile-time options:
  1095.  
  1096.     * DIRSTACK_DEFAULT_SIZE: The amount of bytes reserved to store items
  1097.       of the directory stack. Default: 256 
  1098.  
  1099. ------------------------------------------------------------------------
  1100.  
  1101.  
  1102.     FEATURE_HISTORY - Command line history
  1103.  
  1104. See also: HISTORY <#history>
  1105. Requirements: FEATURE_ENHANCED_INPUT <#feature_enhanced_input>
  1106.  
  1107. If enabled on compilation of FreeCOM and the enhanced command line
  1108. editing is acivated as well, the command line history becomes available.
  1109.  
  1110. When commands are enterred manually on the command line prompt of
  1111. FreeCOM, old command lines are storred in the history and can be
  1112. retrieved later using the key bindings of F3, F1 and the cursor Up and
  1113. Down keys.
  1114. Without the command line history at most one line is cached.
  1115.  
  1116. The command:
  1117. HISTORY <#history>
  1118.  
  1119. displays all cached command lines.
  1120.  
  1121. The command:
  1122. HISTORY /number/
  1123.  
  1124. resizes the amount of bytes reserved to cache command lines to /number/
  1125. bytes. Doing so all cached command lines are deleted.
  1126.  
  1127. Each instance of FreeCOM maintains its own command line history, which
  1128. is initially inherited from the particular parent instance, if any.
  1129.  
  1130.  
  1131.       Options
  1132.  
  1133. Compile-time options:
  1134.  
  1135.     * HISTORY_DEFAULT_SIZE: The amount of bytes reserved initially.
  1136.       Default: 256 
  1137.  
  1138. ------------------------------------------------------------------------
  1139.  
  1140.  
  1141.     FEATURE_LAST_DIR - Change back to last directory
  1142.  
  1143. See also: CD <#cd>, CDD <#cdd>, CHDIR <#chdir>, POPD <#popd>, PUSHD <#pushd>
  1144.  
  1145. If defined on compilation of FreeCOM, every change of the current
  1146. directory using an internal command records the previous directory and
  1147. enables the /-/ shortcut for CD <#cd>, CDD <#cdd> and CHDIR <#chdir>.
  1148.  
  1149.  
  1150.         Example:
  1151.  
  1152. C> CD <#cd> \
  1153. C> CD <#cd> freedos\bin
  1154. C> CD <#cd> -
  1155. C> CD <#cd> -
  1156.  
  1157. The first CD <#cd> command changes into the root direcotry, the second
  1158. into the directory \FREEDOS\BIN, any subsequent CD <#cd> - commands will
  1159. change between the root directory and \FREEDOS\BIN.
  1160.  
  1161. ------------------------------------------------------------------------
  1162.  
  1163.  
  1164.     FOR - Repeat a command
  1165.  
  1166. Requirements: CMD_FOR
  1167.  
  1168.  
  1169.       Synopsis
  1170.  
  1171. FOR '%' /letter/ IN '(' *{* /word/ | /pattern/ *}* ')' DO ½any command╗
  1172. Executes ½any command╗ for several values assigned to the variable
  1173. /letter/. The values are read strictly left to right from the /word/s
  1174. and /pattern/s enclosed in parenthises; where /pattern/s are words
  1175. containing wildcards and are replaced by all matching filenames.
  1176.  
  1177. Any occurence of a percent sign % and the specified letter is replaced
  1178. by the current value of the FOR <#for> loop. /Note:/ The letter is
  1179. case-sensitively matched!
  1180.  
  1181. *Warning #1*: Unlike most commands I/O-redirections
  1182. <#_appendix_redirection> are passed forth to the command instead of to
  1183. apply them to FOR <#for> itself, e.g.:
  1184. FOR <#for> %a IN (*.*) DO ECHO <#echo> %a >q
  1185. repeatedly executes the ECHO <#echo> command with the redirection >q,
  1186. hence, effectively overwriting the file each time.
  1187. *Warning #2*: Due the syntactical problem that the FOR <#for> variable
  1188. is specified as '%' /letter/, which is also a legal start of an
  1189. environment variable, the following kludge had been included to support
  1190. FOR <#for> and its special variables:
  1191.  
  1192.     * You can use as many percent character as you wish as long as you
  1193.       use exactly the same number for a particular FOR <#for> variable.
  1194.     * Before any environment variables are expanded, the command line is
  1195.       checked for the skeleton specified within the synopsis (there must
  1196.       not be specified no redirection between the FOR <#for> and DO
  1197.       keywords), if it is found, the FOR <#for> command is executed
  1198.       /without/ expanding any environment variables -- they get expanded
  1199.       each time the command is invoked.
  1200.     * *Known Bug*: Otherwise any environment variables are expanded and,
  1201.       if it happens that a valid FOR <#for> command is found now, the
  1202.       environment variables within the command are expanded a second
  1203.       time. In this case the I/O redirections are applied to FOR <#for>,
  1204.       too, instead of passing them forth to the command.
  1205.     * FOR <#for> commands as part of the command of CALL <#call>, IF
  1206.       <#if>, and FOR <#for> itself are never found before expanding the
  1207.       environment variables. 
  1208.  
  1209.  
  1210. *Warning #3*: Due a bug in MS COMMAND (BugID #1050) the right
  1211. parenthesis *must* be followed by at least one whitespace, this allows
  1212. the "/feature/" to embed such characters within the words and patterns,
  1213. e.g.:
  1214. FOR <#for> %a in (a()a b()b) DO command
  1215. executes the command two times, first replacing %a by a()a, second by b()b.
  1216.  
  1217.  
  1218.       Examples
  1219.  
  1220.  
  1221.         Example: 1
  1222.  
  1223. FOR <#for> %z IN (*.*) DO copy %a a:
  1224. Performs a COPY <#copy> xyz A: command for each file in the current
  1225. directory. Its behaviour is equal to COPY <#copy> *.* A:
  1226.  
  1227.  
  1228.         Example: 2
  1229.  
  1230. FOR <#for> %z IN (a?b*.TXT) DO CALL <#call> batch arg %z
  1231. Executes the batch script batch.bat for each file matching the pattern
  1232. A?B*.TXT located in the current directory. Within the script, the
  1233. automatic variable /%1/ always expands to the constant argument /arg/,
  1234. whereas /%2/ expands to the filename of the current loop.
  1235.  
  1236.  
  1237.         Example: 3
  1238.  
  1239. FOR <#for> %a IN (1 2 3 4 5) DO ECHO <#echo> %a
  1240. Is equal to the command sequence:
  1241. ECHO <#echo> 1
  1242. ECHO <#echo> 2
  1243. ECHO <#echo> 3
  1244. ECHO <#echo> 4
  1245. ECHO <#echo> 5
  1246. Because these words do /not/ contain no wildcards, they are /not/
  1247. matched as filenames.
  1248.  
  1249.  
  1250.         Example: 4
  1251.  
  1252. FOR <#for> %g IN (1 2 3*) DO ECHO <#echo> %g
  1253. Performs the commands:
  1254. ECHO <#echo> 1
  1255. ECHO <#echo> 2
  1256. and the ECHO <#echo> command for each file in the current directory,
  1257. that has no extension and which name starts with the digit three.
  1258.  
  1259. ------------------------------------------------------------------------
  1260.  
  1261.  
  1262.     GOTO - Goto label
  1263.  
  1264. Requirements: CMD_GOTO
  1265.  
  1266.  
  1267.       Synopsis
  1268.  
  1269. GOTO *[* ':' *]* /label/
  1270. Normally all commands of a batch script are executed in the sequence in
  1271. which they are appear with the script. GOTO <#goto> controls the command
  1272. flow by unconditionally jumping to the specified /label/; the commands
  1273. following that label will be executed then. A label is written as a
  1274. colon in the first column of a line and the name of the label
  1275. immediately behind. If FreeCOM hits a label in the normal flow, it is
  1276. ignored completely, even any redirection characters are ignored.
  1277.  
  1278. The /label/ must be located in the same script file as the GOTO <#goto>
  1279. itself, if it appears more than once, the first occurance takes precedence.
  1280.  
  1281. Conditional jumps can be contructed with help of the IF <#if> command,
  1282. see example 2.
  1283.  
  1284.  
  1285.       Examples
  1286.  
  1287.  
  1288.         Example: 1
  1289.  
  1290. GOTO <#goto> ende
  1291. Jumps the to label :ende
  1292.  
  1293.  
  1294.         Example: 2
  1295.  
  1296. IF <#if> "%1"=="" GOTO <#goto> emptyCommandLine
  1297. Jumps to label :emptyCommandLine, if no argument had been passed to the
  1298. batch script. For instance:
  1299.  
  1300. @ECHO <#echo> OFF
  1301. IF <#if> "%1"=="" GOTO <#goto> error
  1302. REM <#rem> do something sane here
  1303. GOTO <#goto> ende
  1304.  
  1305. :error
  1306. ECHO <#echo> You must pass an argument to me!
  1307.  
  1308. :ende
  1309.  
  1310. ------------------------------------------------------------------------
  1311.  
  1312.  
  1313.     HISTORY - Display command line history
  1314.  
  1315. Requirements: FEATURE_HISTORY <#feature_history>
  1316.  
  1317.  
  1318.       Synopsis
  1319.  
  1320.    1. HISTORY
  1321.    2. HISTORY /number/
  1322.  
  1323. The first format without any argument displays all cached command lines.
  1324.  
  1325. The second format resizes the memory pre-allocated for the command line
  1326. history cache to /number/ bytes.
  1327.  
  1328. ------------------------------------------------------------------------
  1329.  
  1330.  
  1331.     IF - Conditional execution of a command
  1332.  
  1333.  
  1334.       Synopsis
  1335.  
  1336.    1. IF *[* NOT *]* EXIST /file/ ½command╗
  1337.    2. IF *[* NOT *]* ERRORLEVEL /number/ ½command╗
  1338.    3. IF *[* NOT *]* /string/ '==' /word/ ½command╗
  1339.    4. IF *[* NOT *]* /quoted-string/ '==' /quoted-string/ ½command╗
  1340.  
  1341. Conditionally executes the specified ½command╗. If the keyword NOT is
  1342. specified, the condition is negated, meaning, the ½command╗ is executed,
  1343. if the condition evaluates to false.
  1344.  
  1345. The first condition evaluates to true, if the specified /file/ exists.
  1346. Wildcards are supported. On local file systems one can test for
  1347. character devices, too.
  1348.  
  1349. The second variant evaluates to true, if the errorlevel is currently
  1350. assigned to a number greater or equal than the specified /number/.
  1351. Errorlevels are assigned when external commands terminates or via CANCEL
  1352. <#cancel> or QUIT <#quit>.
  1353.  
  1354. The third and four ones are true, when the left string is
  1355. case-sensitively equal to the string on the right side of the double
  1356. equal sign. Either side may be quoted by double quotes, though, if the
  1357. right side is /not/ quoted, the first word is tested only.
  1358.  
  1359.  
  1360.       Examples
  1361.  
  1362.  
  1363.         Example: 1
  1364.  
  1365. IF <#if> NOT EXIST c:\command.com ECHO <#echo> There is no COMMAND.COM
  1366. in C:\
  1367.  
  1368. Executes the ECHO <#echo> command, if a file C:\COMMAND.COM does /not/
  1369. exist.
  1370.  
  1371.  
  1372.         Example: 2
  1373.  
  1374. IF <#if> EXIST c:\fdos\nul GOTO <#goto> have_fdos_directory
  1375.  
  1376. Branch the interpretation of the batch script to the label, if the file
  1377. C:\FDOS\NUL exists. Because the filename NUL corresponds to the
  1378. character device NUL:, which always exists, this test may be used to
  1379. probe for the existance of the path C:\FDOS, because all character
  1380. devices are virtually present in every directory of local filesystems.
  1381.  
  1382.  
  1383.         Example: 3
  1384.  
  1385. IF <#if> %1==name ECHO <#echo> First argument is "name"
  1386.  
  1387. ECHO <#echo> is executed, if the first argument of the current batch
  1388. script is /"name"/ (without the quotes). %1 may expand to any string,
  1389. even with embedded whitespaces, but without an embedded double equal
  1390. sign. Also, metacharacters included within the argument are evaluated.
  1391.  
  1392.  
  1393.         Example: 4
  1394.  
  1395. IF <#if> "%1"=="first name" ECHO <#echo> First argument is "first name"
  1396.  
  1397. ECHO <#echo> is executed, if the first argument of the current batch
  1398. script is /"first name"/ (without the quotes). %1 may expand to any
  1399. string, even with embedded whitespaces or an embedded double equal sign
  1400. or metacharacters.
  1401.  
  1402. ------------------------------------------------------------------------
  1403.  
  1404.  
  1405.     FEATURE_LOAD_MESSAGES - Load messages permanently
  1406.  
  1407. If enabled on compilation of FreeCOM, the */MSG* becomes available.
  1408.  
  1409. If this option is present, when an instance of FreeCOM is created, the
  1410. FreeCOM messages are loaded into memory permanently. Otherwise, the
  1411. messages are loaded on demand and are removed from memory when an
  1412. external command is executed, in order to conserve memory.
  1413.  
  1414. This feature may help to run FreeCOM on disk- and floppyless boxes.
  1415.  
  1416. ------------------------------------------------------------------------
  1417.  
  1418.  
  1419.     LOADFIX - Load an external program above the first 64KB memory
  1420.  
  1421. See also: CALL <#call>, LOADHIGH <#loadhigh>
  1422.  
  1423.  
  1424.       Synopsis
  1425.  
  1426. LOADFIX /program/ *[{* /argument/ *}]*
  1427. Loads and executes an exepacked program, that would abort execution with
  1428. the error message "Packed file corrupt" otherwise.
  1429.  
  1430. /Attention:/ This command is not available in the XMS-only variant of
  1431. FreeCOM!
  1432.  
  1433.  
  1434.         Example:
  1435.  
  1436. LOADFIX <#loadfix> program.exe
  1437.  
  1438. ------------------------------------------------------------------------
  1439.  
  1440.  
  1441.     LOADHIGH - Load an external program into high memory
  1442.  
  1443. See also: CALL <#call>, LOADFIX <#loadfix>
  1444.  
  1445.  
  1446.       Synopsis
  1447.  
  1448. LOADHIGH *[{* /option/ *}]* /program/ *[{* /argument/ *}]*
  1449. Loads and executes an external program in high memory, also called UMB.
  1450. This command is used to load TSRs, such mouse drivers, into the upper
  1451. memory to conserve the conventional memory for programs.
  1452.  
  1453.  
  1454.         Example:
  1455.  
  1456. LOADHIGH <#loadhigh> lmouse.com
  1457.  
  1458. ------------------------------------------------------------------------
  1459.  
  1460.  
  1461.     MD - make directory
  1462.  
  1463. See also: CD <#cd>, MKDIR <#mkdir>, RD <#rd>
  1464. Requirements: CMD_MKDIR
  1465.  
  1466.  
  1467.       Synopsis
  1468.  
  1469. MD /path/
  1470. Creates a directory of the specified name /path/. Any parent directories
  1471. must already exist.
  1472.  
  1473.  
  1474.       Examples
  1475.  
  1476.  
  1477.         Example: 1
  1478.  
  1479. MD <#md> C:\1
  1480.  
  1481. Creates the directory 1 in the root directory of drive C:.
  1482.  
  1483.  
  1484.         Example: 2
  1485.  
  1486. MKDIR <#mkdir> C:\1\2\3
  1487.  
  1488. Creates the directory 3 in the directory \1\2 of drive C:. If the
  1489. directory C:\1\2 does not exist, yet, the command fails.
  1490.  
  1491. ------------------------------------------------------------------------
  1492.  
  1493.  
  1494.     MEMORY - Display the internally used memory
  1495.  
  1496. Requirements: CMD_MEMORY
  1497.  
  1498.  
  1499.       Synopsis
  1500.  
  1501. MEMORY
  1502.  
  1503. Displays the useage of internal memory of FreeCOM. Note: The internals
  1504. of FreeCOM are currently under heavy construction, the actual output
  1505. might vary heavily from this example.
  1506.  
  1507.  
  1508.       Examples
  1509.  
  1510. MEMORY <#memory>
  1511. may display this:
  1512.  
  1513. Environment segment    : max  1200 bytes; free     8 bytes
  1514. Context segment        : max  2304 bytes; free  2252 bytes
  1515.         Aliases        : limit  1024 bytes, current     5 bytes,     0 items
  1516.         History        : limit   256 bytes, current    34 bytes,     2 items
  1517.         Directory stack: limit   256 bytes, current     5 bytes,     0 items
  1518.         Last dir cache : used      0 bytes,     0 items
  1519.         Swapinfo       : used      0 bytes,     0 items
  1520. Heap                   : free 482080 bytes
  1521.  
  1522.     * The Environment segment is the storage area, the environment
  1523.       variables are storred in. It may be changed passing the */E*
  1524.       option to FreeCOM.
  1525.     * FreeCOM stores several internal information into the Context
  1526.       segment; the aliases - modified by the ALIAS <#alias> command -,
  1527.       the history - displayed using the HISTORY <#history> command,
  1528.       accessed by pressing the cursor Up/Down keys on command line -,
  1529.       the directory stack - displayed with the DIRS <#dirs> command and
  1530.       accessed using the PUSHD <#pushd> and POPD <#popd> commands -, the
  1531.       last directory - accessed with the CD <#cd> - command -, and,
  1532.       finally, some internal command used by the low-level swap
  1533.       interface of FreeCOM.
  1534.     * The heap is the storage area FreeCOM can allocated memory from
  1535.       itself. This value is useful for FreeCOM developers mostly. 
  1536.  
  1537.     * max specifies the maximum amount of bytes allocatable within this
  1538.       storage area.
  1539.     * free specifies the unused bytes within this storage area.
  1540.     * limit specifies the maximum amount of bytes allocatable for the
  1541.       particular information within the area.
  1542.     * current specifies the amount of bytes currently allocated for the
  1543.       particular information.
  1544.     * items specifies the number of items storred for the particular
  1545.       information, e.g. how many directories have been pushed onto the
  1546.       stack using PUSHD <#pushd>. 
  1547.  
  1548. ------------------------------------------------------------------------
  1549.  
  1550.  
  1551.     MKDIR - Make directory
  1552.  
  1553. This command is 100% compatible to MD <#md>, please see there
  1554.  
  1555. ------------------------------------------------------------------------
  1556.  
  1557.  
  1558.     PATH - Display or set the search path
  1559.  
  1560. Requirements: CMD_PATH
  1561.  
  1562.  
  1563.       Synopsis
  1564.  
  1565.    1. PATH
  1566.    2. PATH *[* '=' *]* *{* /path/ *:* ';' *}*
  1567.    3. PATH;
  1568.  
  1569. Displays or assigns a new search path.
  1570.  
  1571. The first variant displays the currently active search path.
  1572.  
  1573. The second one assigns the specified paths to the search path. The
  1574. leading equal sign, if present, is ignored.
  1575.  
  1576. The third variant empties the search path.
  1577.  
  1578. When FreeCOM searches for an external command or a batch script, which
  1579. has no path specified, it is search for in all the directories specified
  1580. in the search path. If the current directory . is not mentioned in the
  1581. search path, it is searched through first.
  1582.  
  1583.  
  1584.       Examples
  1585.  
  1586.  
  1587.         Example: 1
  1588.  
  1589. PATH <#path> c:\fdos\bin;c:\tools;d:\others\bin;bin
  1590.  
  1591. If FreeCOM is to execute an external program, e.g. XCOPY, FreeCOM will
  1592. search for the program in the following directories in the specified
  1593. order, the first program file found is executed:
  1594.  
  1595.    1. the current directory
  1596.    2. C:\FDOS\BIN
  1597.    3. C:\TOOLS
  1598.    4. D:\OTHERS\BIN
  1599.    5. BIN 
  1600.  
  1601.  
  1602. Note: Because the last directory specification is a relative one, rather
  1603. than an absolute one, the program is searched for in the sub-directory
  1604. BIN of the current directory.
  1605.  
  1606. ------------------------------------------------------------------------
  1607.  
  1608.  
  1609.     PAUSE - Pauses batch file execution
  1610.  
  1611. Requirements: CMD_PAUSE
  1612.  
  1613.  
  1614.       Synopsis
  1615.  
  1616.    1. PAUSE
  1617.    2. PAUSE ½string╗
  1618.  
  1619. Pauses the batch file execution until a key is pressed.
  1620.  
  1621. PAUSE <#pause> prompts the user with the specified string or, if none is
  1622. specifed, "Press any key to proceed"
  1623.  
  1624.  
  1625.       Examples
  1626.  
  1627.  
  1628.         Example: 1
  1629.  
  1630. PAUSE <#pause>
  1631. Just pauses the execution.
  1632.  
  1633.  
  1634.         Example: 2
  1635.  
  1636. PAUSE <#pause> Execution paused, press any key to proceed ...
  1637. Pauses execution displaying this string.
  1638.  
  1639.  
  1640.         Example: 3
  1641.  
  1642. PAUSE <#pause> >nul
  1643. Pauses execution, but does not display any prompt.
  1644.  
  1645. ------------------------------------------------------------------------
  1646.  
  1647.  
  1648.     POPD - Change back to the last pushed directory
  1649.  
  1650. See also: CD <#cd>, CDD <#cdd>, DIRS <#dirs>, POPD <#popd>
  1651. Requirements: CMD_CDD, CMD_POPD
  1652.  
  1653.  
  1654.       Synopsis
  1655.  
  1656.    1. POPD
  1657.    2. POPD '*'
  1658.  
  1659. The first variant changes the current directory back to the one, in
  1660. which the last PUSHD <#pushd> command was executed.
  1661.  
  1662. The second one clears all entries of the directory stack, but does not
  1663. change the current directory.
  1664.  
  1665. ------------------------------------------------------------------------
  1666.  
  1667.  
  1668.     PROMPT - Display or set the shell prompt
  1669.  
  1670. Requirements: CMD_PROMPT
  1671.  
  1672.  
  1673.       Synopsis
  1674.  
  1675. PROMPT
  1676. PROMPT *[* '=' *]* /prompt/
  1677.  
  1678.  
  1679.       Options
  1680.  
  1681. Unless stated otherwise all options of this command do follow the
  1682. standard rules for options <#_appendix_options>.
  1683.  
  1684.  
  1685.       Examples
  1686.  
  1687.  
  1688.         Example: 1
  1689.  
  1690. ------------------------------------------------------------------------
  1691.  
  1692.  
  1693.     PUSHD - Push the current working directory onto the directory stack
  1694.  
  1695. See also: CD <#cd>, CDD <#cdd>, DIRS <#dirs>, POPD <#popd>
  1696. Requirements: CMD_CDD, CMD_PUSHD
  1697.  
  1698.  
  1699.       Synopsis
  1700.  
  1701. PUSHD /directory/
  1702.  
  1703.  
  1704.       Options
  1705.  
  1706. Unless stated otherwise all options of this command do follow the
  1707. standard rules for options <#_appendix_options>.
  1708.  
  1709.  
  1710.       Examples
  1711.  
  1712.  
  1713.         Example: 1
  1714.  
  1715. ------------------------------------------------------------------------
  1716.  
  1717.  
  1718.     QUIT - Terminate the current script
  1719.  
  1720.  
  1721.       Synopsis
  1722.  
  1723. QUIT *[* /n/ *]*
  1724. Terminates the current active batch script and, if present, assigns the
  1725. specified number /n/ to the errorlevel.
  1726.  
  1727. /Note/: This command is a hidden internal command <#_appendix_hicmd>.
  1728.  
  1729. ------------------------------------------------------------------------
  1730.  
  1731.  
  1732.     RD - Remove directory
  1733.  
  1734. See also: CD <#cd>, MD <#md>, RMDIR <#rmdir>
  1735. Requirements: CMD_RMDIR
  1736.  
  1737.  
  1738.       Synopsis
  1739.  
  1740. RD /path/
  1741.  
  1742.  
  1743.       Options
  1744.  
  1745. Unless stated otherwise all options of this command do follow the
  1746. standard rules for options <#_appendix_options>.
  1747.  
  1748.  
  1749.       Examples
  1750.  
  1751.  
  1752.         Example: 1
  1753.  
  1754. ------------------------------------------------------------------------
  1755.  
  1756.  
  1757.     REM - Marks comments or remarks in batchfiles
  1758.  
  1759. Requirements: CMD_REM
  1760.  
  1761.  
  1762.       Synopsis
  1763.  
  1764. REM ½string╗
  1765.  
  1766.  
  1767.       Options
  1768.  
  1769. Unless stated otherwise all options of this command do follow the
  1770. standard rules for options <#_appendix_options>.
  1771.  
  1772.  
  1773.       Examples
  1774.  
  1775.  
  1776.         Example: 1
  1777.  
  1778. ------------------------------------------------------------------------
  1779.  
  1780.  
  1781.     REN - Rename files
  1782.  
  1783. See also: RENAME <#rename>
  1784. Requirements: CMD_RENAME
  1785.  
  1786.  
  1787.       Synopsis
  1788.  
  1789. REN /source/ /destination/
  1790.  
  1791.  
  1792.       Options
  1793.  
  1794. Unless stated otherwise all options of this command do follow the
  1795. standard rules for options <#_appendix_options>.
  1796.  
  1797.  
  1798.       Examples
  1799.  
  1800.  
  1801.         Example: 1
  1802.  
  1803. ------------------------------------------------------------------------
  1804.  
  1805.  
  1806.     RENAME - Rename files
  1807.  
  1808. This command is 100% compatible to REN <#ren>, please see there
  1809.  
  1810. ------------------------------------------------------------------------
  1811.  
  1812.  
  1813.     RMDIR - Remove directory
  1814.  
  1815. This command is 100% compatible to RD <#rd>, please see there
  1816.  
  1817. ------------------------------------------------------------------------
  1818.  
  1819.  
  1820.     SET - Display or set environment variables
  1821.  
  1822. Requirements: CMD_SET
  1823.  
  1824.  
  1825.       Synopsis
  1826.  
  1827.    1. SET *[{* /option/ *}]*
  1828.    2. SET *[{* /option/ *}]* /variable/ '=' ½string╗
  1829.  
  1830. The first variant (without any argument) displays all the currently
  1831. defined environment variables in the format (without any whitespaces
  1832. before or after the equal sign): /name/ '=' ½value╗
  1833.  
  1834. The second variant assigns a new value ½string╗ to the specified
  1835. /variable/. If the /variable/ already exists, the old value is
  1836. overwritten without notice; otherwise it is newly created.
  1837.  
  1838.  
  1839.       Options
  1840.  
  1841. Unless stated otherwise all options of this command do follow the
  1842. standard rules for options <#_appendix_options>. All options must
  1843. preceed the assigment, if present.
  1844.  
  1845.     * */C*: forces to keep the exact case of the letters of the variable
  1846.       name; by default all letters are uppercased to keep compatibly.
  1847.     * */I*: has been temporarily included to the SET <#set> command to
  1848.       allow an easy way to display the current size of the environment
  1849.       segment, because it is one of the most frequently reported, but
  1850.       not reproduceable bug report. Once this option has been
  1851.       encountered, all the remaining command line is ignored.
  1852.     * */P*: Prompts the user with the specified ½string╗ and assigns the
  1853.       user's input to the /variable/. If no input is made, hence, one
  1854.       taps just ENTER, an empty value is assigned to the /variable/,
  1855.       which is then removed from the environment. 
  1856.  
  1857. ------------------------------------------------------------------------
  1858.  
  1859.  
  1860.     SHIFT - Shift the arguments of a batch script
  1861.  
  1862. Requirements: CMD_SHIFT
  1863.  
  1864.  
  1865.       Synopsis
  1866.  
  1867.    1. SHIFT
  1868.    2. SHIFT DOWN
  1869.  
  1870. Shifts the arguments of a batch script one position up (first variant)
  1871. or down (second variant).
  1872.  
  1873. Within a batch script the automatic variables %0 through %9 are replaced
  1874. by the script name and the first nine arguments. This can be imagined as
  1875. a window to ten arguments of the script. SHIFT <#shift> will allow to
  1876. move this window of ten arguments towards its end (up) or its start (down).
  1877.  
  1878. After SHIFT <#shift> has been executed, the former %0 is hidden and
  1879. inaccessable, %1 became %0, %2 became %1 a.s.o, %9 became %8 and the
  1880. formerly hidden tenth argument became %9.
  1881. SHIFT <#shift> DOWN reverses one SHIFT <#shift> command.
  1882.  
  1883. SHIFT <#shift> can be called as many times as wanted, SHIFT <#shift>
  1884. DOWN won't allow to underflow the very first argument.
  1885.  
  1886.  
  1887.       Examples
  1888.  
  1889.  
  1890.         Example: 1
  1891.  
  1892. If the batch script B.BAT:
  1893. @ECHO <#echo> OFF
  1894. ECHO <#echo> 0: %0
  1895. ECHO <#echo> 1: %1
  1896. ECHO <#echo> 2: %2
  1897. had been executed using:
  1898. B.BAT 1 2 3 4
  1899. it displays:
  1900.  
  1901. B.BAT
  1902. 1
  1903. 2
  1904.  
  1905.  
  1906. If a SHIFT <#shift> command had been inserted as second line, the same
  1907. call displays:
  1908.  
  1909. 1
  1910. 2
  1911. 3
  1912.  
  1913. ------------------------------------------------------------------------
  1914.  
  1915.  
  1916.     TIME - Display or set current time
  1917.  
  1918. See also: DATE <#date>
  1919. Requirements: CMD_TIME
  1920.  
  1921.  
  1922.       Synopsis
  1923.  
  1924.    1. TIME *[* */T* *]*
  1925.    2. TIME *[* */T* *]* /time/
  1926.  
  1927. Variant 1 displays the current time, then enters a loop prompting the
  1928. user to enter a new time. The loops terminates when a valid time had
  1929. entered or the user just pressed the ENTER key.
  1930.  
  1931. Variant 2 does not display the current time, but tries to change the
  1932. current time to the specified /time/, on failure the loop as explained
  1933. above is entered.
  1934.  
  1935. The individual portions of a time may be sperated by at least: dots .,
  1936. colons : and forward slashes /. Other nationally used characters may be
  1937. supported, too. If a certain number of portions are specified:
  1938.  
  1939.    1. error,
  1940.    2. hour:minute; seconds and hundreds default to zero,
  1941.    3. hour:minute:seconds; hundreds defaults to zero,
  1942.    4. hour:minute:seconds.hundreds;
  1943.    5. more than 4 portions result in an error. 
  1944.  
  1945. Separated by no, one or more whitespaces the am/pm modifiers may follow
  1946. optionally. If present they alter the given time as follows:
  1947.  
  1948.     * AM: if hour is equal to 12, it becomes 0 (midnight).
  1949.     * PM: f hour is greater than 12, it is incremented by 12. 
  1950.  
  1951.  
  1952.       Options
  1953.  
  1954. All options must preceed any arguments.
  1955.  
  1956. */T*: prevents from prompting the user.
  1957.  
  1958.    1. In variant 1, the time is displayed only.
  1959.    2. In variant 2, the time is tried to be changed, but the loop is not
  1960.       entered on failure. 
  1961.  
  1962.  
  1963.       Examples
  1964.  
  1965.  
  1966.         Example: 1
  1967.  
  1968. TIME <#time> /T
  1969. Just displays the current time.
  1970.  
  1971.  
  1972.         Example: 2
  1973.  
  1974. TIME <#time> 18:2
  1975. Sets the current system time to 6:02 PM.
  1976.  
  1977. ------------------------------------------------------------------------
  1978.  
  1979.  
  1980.     TRUENAME - Display the true name of a file
  1981.  
  1982. Requirements: CMD_TRUENAME
  1983.  
  1984.  
  1985.       Synopsis
  1986.  
  1987. TRUENAME /path/
  1988.  
  1989.  
  1990.       Options
  1991.  
  1992. Unless stated otherwise all options of this command do follow the
  1993. standard rules for options <#_appendix_options>.
  1994.  
  1995.  
  1996.       Examples
  1997.  
  1998.  
  1999.         Example: 1
  2000.  
  2001. ------------------------------------------------------------------------
  2002.  
  2003.  
  2004.     TYPE - Display the contents of files
  2005.  
  2006. See also: DIR <#dir>, ECHO <#echo>
  2007. Requirements: CMD_TYPE
  2008.  
  2009.  
  2010.       Synopsis
  2011.  
  2012. TYPE *{* /pattern/ *}*
  2013.  
  2014.  
  2015.       Options
  2016.  
  2017. Unless stated otherwise all options of this command do follow the
  2018. standard rules for options <#_appendix_options>.
  2019.  
  2020.  
  2021.       Examples
  2022.  
  2023.  
  2024.         Example: 1
  2025.  
  2026. ------------------------------------------------------------------------
  2027.  
  2028.  
  2029.     VER - Display the version information about FreeCOM and DOS
  2030.  
  2031. Requirements: CMD_VER
  2032.  
  2033.  
  2034.       Synopsis
  2035.  
  2036. VER *[{* /option/ *}]*
  2037.  
  2038.  
  2039.       Options
  2040.  
  2041. Unless stated otherwise all options of this command do follow the
  2042. standard rules for options <#_appendix_options>.
  2043.  
  2044.  
  2045.       Examples
  2046.  
  2047.  
  2048.         Example: 1
  2049.  
  2050. ------------------------------------------------------------------------
  2051.  
  2052.  
  2053.     VERIFY - Display or set verify level
  2054.  
  2055. Requirements: CMD_VERIFY
  2056.  
  2057.  
  2058.       Synopsis
  2059.  
  2060. VERIFY *[* ON | OFF *]*
  2061.  
  2062.  
  2063.       Options
  2064.  
  2065. Unless stated otherwise all options of this command do follow the
  2066. standard rules for options <#_appendix_options>.
  2067.  
  2068.  
  2069.       Examples
  2070.  
  2071.  
  2072.         Example: 1
  2073.  
  2074. ------------------------------------------------------------------------
  2075.  
  2076.  
  2077.     VOL - Display the volume label of a drive
  2078.  
  2079. See also: DIR <#dir>
  2080.  
  2081.  
  2082.       Synopsis
  2083.  
  2084. VOL *[* /drive/ *]*
  2085.  
  2086.  
  2087.       Options
  2088.  
  2089. Unless stated otherwise all options of this command do follow the
  2090. standard rules for options <#_appendix_options>.
  2091.  
  2092.  
  2093.       Examples
  2094.  
  2095.  
  2096.         Example: 1
  2097.  
  2098. ------------------------------------------------------------------------
  2099.  
  2100.  
  2101.     WHICH - Search and display the executable file of specified commands
  2102.  
  2103. Requirements: CMD_WHICH
  2104.  
  2105.  
  2106.       Synopsis
  2107.  
  2108. WHICH *[{* /command/ *}]*
  2109.  
  2110. Searches for the specified command(s) the same way as if it would be
  2111. specified on command line as command itself. If an executable file is
  2112. found, its path is displayed in this format:
  2113. /command/ ½tab╗ /path/
  2114.  
  2115. The ½tab╗ stands for the tabulator character (ASCII 9).
  2116. If the command is not found only the /command/ part, but neither a
  2117. /path/ nor the ½tab╗ is displayed.
  2118.  
  2119. Internal commands, installable commands and aliases are not found.
  2120.  
  2121.  
  2122.       Examples
  2123.  
  2124.  
  2125.         Example: 1
  2126.  
  2127. WHICH <#which> which
  2128. Returns a file or nothing, because WHICH <#which> is an internal command.
  2129.  
  2130.  
  2131.         Example: 2
  2132.  
  2133. WHICH <#which> command
  2134. Could display for instance:
  2135.  
  2136. command    C:\COMMAND.COM
  2137.  
  2138. Please note that command is the string "command" and no placeholder.
  2139.  
  2140. ------------------------------------------------------------------------
  2141.  
  2142.  
  2143.     Appendix
  2144.  
  2145.  
  2146.       Current Directory
  2147.  
  2148. The current directory is the default directory of a drive.
  2149.  
  2150. DOS stores a default directory for each drive. When a path is specified
  2151. with a drive specification only, such as D:, it is completed with this
  2152. default directory of that drive to construct the absolute path
  2153. <#_appendix_abspath> to be used.
  2154.  
  2155.  
  2156.       Current Working Direcory
  2157.  
  2158. In opposite to the current directory the current /working/ directory is
  2159. the absolute path <#_appendix_abspath> constructed out of the currently
  2160. selected drive <#chgdrive> and current directory <cd> of that drive.
  2161.  
  2162.  
  2163.       Path Specification
  2164.  
  2165. In DOS an absolute path is constructed out of several components:
  2166.  
  2167.    1. drive,
  2168.    2. directory,
  2169.    3. filename, and
  2170.    4. file extension. 
  2171.  
  2172. like this: D:\DIR1\DIR2\FILENAME.EXT.
  2173.  
  2174. The drive is a single letter from A through Z followed by a colon :.
  2175.  
  2176. The remaining part of a path consists of similiar components delimited
  2177. by a single backslash \. The last component is also called filename.
  2178. Each of these components may be formed of a name, up to eight characters
  2179. long, and an extension, up to three characters long. Both parts are
  2180. delimited by a single dot .. Although the extension may be absent, the
  2181. filename must have at least one character.
  2182. Note: The term /filename/ is not limited to /files/ in the usual sense,
  2183. but may apply to any name visible in a directory, such as subdirectories
  2184. and volume labels, as well.
  2185.  
  2186. To ease the way to enter a path the user may specify a relative path,
  2187. rather than an absolute one. In such path one or more components may be
  2188. missing:
  2189.  
  2190.     * If no drive is specified, what means that no colon is specified,
  2191.       the path is prefixed by the currently selected drive <#chgdrive>.
  2192.     * If the directory is not prefixed by the backslash or no directory
  2193.       is specified at all, the current directory <#_appendix_currdir> of
  2194.       the drive is inserted right behind the colon.
  2195.     * Some programs may append an absent extension to the very last
  2196.       filename component. 
  2197.  
  2198. Examples, assume the current directories of
  2199. *Drive* *Current Directory*
  2200. C: \FREEDOS\HELP
  2201. D: \TEMP\TEXT
  2202.  
  2203. The currently selected drive is C:.
  2204.  
  2205.    1. C:\
  2206.       The root directory of drive C:.
  2207.    2. .
  2208.       The current working directory, ergo: C:\FREEDOS\HELP.
  2209.    3. ..
  2210.       The parent directory, ergo: C:\FREEDOS.
  2211.    4. D:
  2212.       The current directory of drive D:, ergo: D:\TEMP.
  2213.    5. D:.
  2214.       The current directory of drive D:, ergo: D:\TEMP.
  2215.    6. D:..
  2216.       The parent directory of drive D:, ergo: D:\.
  2217.    7. ..\BIN
  2218.       Because there is neither a drive nor a leading backslash, both the
  2219.       currently selected drive and the current directory of that drive
  2220.       is inserted before the given path, ergo: C:\FREEDOS\HELP\..\BIN.
  2221.       The embedded component .. has the same meaning as when specified
  2222.       alone: /parent directory/, though, here in the context of the
  2223.       directory C:\FREEDOS\HELP\. That means that the final absolute
  2224.       path is: C:\FREEDOS\BIN. 
  2225.  
  2226. Path specifications that do not conform to above mentioned format lead
  2227. to various different behaviour of the various programs, because there is
  2228. no standard to scan, parse and interprete such patterns. Problems include:
  2229.  
  2230.     * multiple backslashes,
  2231.     * multiple dots,
  2232.     * multiple colons, or a colon at a position unequal to two,
  2233.     * The current directory . or parent directory .. special directories
  2234.       in the context of a root directory, such as C:\., C:\.., or
  2235.       C:\TEMP\..\... 
  2236.  
  2237. Note: The special directories . and .. are no phantom directories or
  2238. virtual entries, but standard entries of every directory except the root
  2239. directories. These entries help crash recovery tools, such as CHKDSK or
  2240. SCANDISK, to find errors within the directory structure and restore it
  2241. to a valid file tree. Therefore a common assumption that a tripple dot
  2242. ... directory means /parent-of-parent/ is incorrect, though, might be
  2243. supported by certain programs.
  2244.  
  2245.  
  2246.       Standard Rules for Options
  2247.  
  2248. Options are prefixed by one forward slash "/", the following character
  2249. identifies the option and is called option character, for instance: */A*
  2250.  
  2251. Some commands do accept long option names, where a complete word
  2252. identifies the option rather than a single character, e.g. */MSG*.
  2253.  
  2254. Some option may be used in conjunction with an argument. The argument is
  2255. appended to the option with one colon ":" or one equal sign "=", for
  2256. instance: */A:hr* or */P=fdexec.bat*.
  2257.  
  2258. Multiple options /without/ argument maybe merged together as a single
  2259. option with or without embedded slashes, e.g. */WS* or */W/S*, instead
  2260. of */W /S*.
  2261. However, because some commands do accept long option names, the way with
  2262. embedded slashes is more secure and is recommended therefore.
  2263. An option with argument may be the last one of such merged options.
  2264.  
  2265. Options without arguments enable or disable certain features. Therefore,
  2266. those options are sometimes called /boolean/ options or flags.
  2267. Boolean options may be optionally prefixed by a plus "+" or minus "-"
  2268. sign. So, the boolean option *O* can be written in three ways:
  2269.  
  2270.    1. */+O*: The option is enabled.
  2271.    2. */-O*: The option is disabled.
  2272.    3. */O*: (neither plus nor minus sign) The option is toggled or
  2273.       flipped; this means if the option is enabled currently, it is
  2274.       disabled; but if it is disabled currently, it is enabled. 
  2275.  
  2276.  
  2277. Without user invention a boolean option is disabled by default, so both
  2278. */+O* and */O* behave the same most of the time. However, some commands
  2279. allow the user to change the default settings of certain options, e.g.
  2280. COPY <#copy> and DIR <#dir>.
  2281.  
  2282.  
  2283.       I/O Redirection
  2284.  
  2285. In DOS the standard input and output can be redirected to a file or
  2286. another device; however, although it is common to use these I/O streams
  2287. today, some programmers cowardly ignore them for reasons of speed or
  2288. program size.
  2289.  
  2290. If the *input* stream is redirected to a file or device, instead of
  2291. polling the keyboard and request the user to interactively enter
  2292. characters via the keyboard, those characters are read from the file or
  2293. device. Usually these programs terminate when the file has been read
  2294. wholely.
  2295.  
  2296. If the *output* stream is redirected to a file or device, instead of
  2297. issuing the information onto screen, it is dumped into the file or
  2298. device. Per convention each program has two output streams: one (called
  2299. standard output) to issue normal information and one (called standard
  2300. error output) for error messages the user should not miss.
  2301.  
  2302. Redirections are specified on command line and effect exactly that
  2303. command invoked herein, regardless if the command is an external or
  2304. internal one, an alias or batch script. The utter exception is the FOR
  2305. <#for> command, which requires that the redirection is to apply to the
  2306. command specified behind the DO keyword rather than FOR <#for> itself.
  2307. If more than one redirection is specified on the command line and they
  2308. effect the same stream (input, output, or error), the rightmost one
  2309. superceed any previous one.
  2310.  
  2311. Redirections are syntactically specified like this:
  2312. /operator/ /target/
  2313. /operator/ *::=* '<' | '>' *[* '>' *]* *[* '&' *[* '>' *]* *]*
  2314. /target/ *::=* /file/ | /device/
  2315.  
  2316. Although it is not relevant where the redirections are placed on the
  2317. command line, it is common praxis to place them at the end of it.
  2318.  
  2319. The /operators/ have the following meaning:
  2320. Operator Redirection
  2321. < Input stream
  2322. > Output stream; target file is overwritten
  2323. >> Output stream; output is appended to target, if it already exists
  2324. >& Output and error stream; target file is overwritten
  2325. >>& Output and error stream; output is appended to target, if it already
  2326. exists
  2327. >&> Error stream; target file is overwritten
  2328. >>&> Error stream; output is appended to target, if it already exists
  2329.  
  2330.  
  2331.       Examples
  2332.  
  2333.  
  2334.         Example: 1
  2335.  
  2336. cmd <in1 <in2
  2337.  
  2338. Input stream is redirected to file IN2, because it is the rightmost one.
  2339.  
  2340.  
  2341.         Example: 2
  2342.  
  2343. cmd <in >&out
  2344.  
  2345. Input stream is redirected to file IN, output and error streams are
  2346. joined together and redireced into file OUT. If the file OUT already
  2347. exists, the old contents is discarded and replaced by the new one;
  2348. otherwise, the OUT is created anew.
  2349.  
  2350.  
  2351.         Example: 3
  2352.  
  2353. cmd <in >>&out
  2354.  
  2355. As example 2, but instead of replacing the contents of OUT, if the file
  2356. already exists, the new information is appended to the end of the file.
  2357.  
  2358.  
  2359.         Example: 4
  2360.  
  2361. FOR <#for> %a IN (*.*) DO ECHO <#echo> %a >out
  2362.  
  2363. As mentioned earlier, FOR <#for> is an exception and passes forth the
  2364. redirections to each invocation of the command specified right of the DO
  2365. keyword. So this examples overwrites the output file each time the ECHO
  2366. <#echo> command is performed, thus, instead of creating a file list,
  2367. only the last found file is recorded into OUT.
  2368.  
  2369.  
  2370.         Example: 5
  2371.  
  2372. IF <#if> EXIST out DEL <#del> out
  2373. FOR <#for> %a IN (*.*) DO ECHO <#echo> %a >>out
  2374.  
  2375. This sequence eliminate the problem, the IF <#if> command is required to
  2376. actually replace the file rather than appending the file list to the
  2377. probably existent file.
  2378.  
  2379.  
  2380.         Pipes
  2381.  
  2382. Another form of redirection is *piping*. Hereby, the output stream of
  2383. one command is connected to the input stream of another command. Pipes
  2384. can combine any number of commands this way. Because DOS is no
  2385. multitasking system, pipes are simulated by spawning the first command
  2386. with an output redirection capturing the issued information into a
  2387. temporary file and then the second command with an input redirection
  2388. from that very same temporary file, on completation of the second
  2389. command the temporary file is deleted.
  2390.  
  2391.  
  2392.       Examples
  2393.  
  2394.  
  2395.         Example: 1
  2396.  
  2397. cmd1 | cmd2 | cmd3
  2398.  
  2399. Which is similiar to this sequence:
  2400. cmd1 >%TEMP%\t1
  2401. cmd2 <%TEMP%\t1 >%TEMP%\t2
  2402. DEL <#del> %TEMP%\t1
  2403. cmd3 <%TEMP%\t2
  2404. DEL <#del> %TEMP%\t2
  2405.  
  2406.  
  2407.         Example: 2
  2408.  
  2409. The first and last command can have an input or output redirection
  2410. respectively, like so:
  2411. cmd1 | cmd2 | cmd3 <in >out
  2412.  
  2413. Which is similiar to this sequence:
  2414. cmd1 >%TEMP%\t1 <in
  2415. cmd2 <%TEMP%\t1 >%TEMP%\t2
  2416. DEL <#del> %TEMP%\t1
  2417. cmd3 <%TEMP%\t2 >out
  2418. DEL <#del> %TEMP%\t2
  2419.  
  2420.  
  2421.         Example: 3
  2422.  
  2423. The error stream can be piped as well:
  2424. cmd1 |& cmd2 | cmd3
  2425.  
  2426. Which is similiar to this sequence:
  2427. cmd1 >&%TEMP%\t1
  2428. cmd2 <%TEMP%\t1 >%TEMP%\t2
  2429. DEL <#del> %TEMP%\t1
  2430. cmd3 <%TEMP%\t2
  2431. DEL <#del> %TEMP%\t2
  2432.  
  2433. Here only the error messages of cmd1 are passed into cmd2; the error
  2434. messages of both cmd2 and cmd3 are issued to the screen.
  2435.  
  2436.  
  2437.         Nested redirections
  2438.  
  2439. Batch scripts or when external programs invoke other programs or another
  2440. shell, redirections may be nested, e.g.:
  2441.  
  2442. Consider the batch file BATCH.BAT:
  2443.  
  2444. @ECHO <#echo> OFF
  2445. ECHO <#echo> 1
  2446. ECHO <#echo> 2 >out_2
  2447. ECHO <#echo> 3
  2448.  
  2449. which is invoked via:
  2450. BATCH >out_1
  2451.  
  2452. When the script BATCH gets executed, the actual output stream is
  2453. redirected to the file OUT_1. Therefore the output of the first ECHO
  2454. <#echo> command is redirected into this file.
  2455. Because the second ECHO <#echo> command has its own output redirection,
  2456. its output is redirected into the file OUT_2. On completion of ECHO
  2457. <#echo> the redirection is closed and the former one is restored.
  2458. What causes that the output of the third ECHO <#echo> command is
  2459. redirected into OUT_1 again.
  2460.  
  2461.  
  2462.       Hidden Internal Commands
  2463.  
  2464. There are some special internal commands, that are not directly visible
  2465. nor accessable. They are hidden because of two main purposes:
  2466.  
  2467.    1. Many of them are of internal nature and should not used by the user.
  2468.    2. They are extensions to the normal batch language and may,
  2469.       therefore, clash with a particular installation. To prevent this
  2470.       clash those commands are hidden by default and can be made
  2471.       directly accessable via the ICMD command. 
  2472.  
  2473. Hidden internal commands can be access by prefixing the command with
  2474. ::=. This token usually specifies a label within the batch language,
  2475. given the nature of the labels, they may be comments as well. Due to the
  2476. latter variant, most non-FreeCOM shells won't see the ::=, hence, ignore
  2477. those commands.
  2478.  
  2479. For example: C> ::=CANCEL <#cancel> 30
  2480.  
  2481. cancels (terminates) all currently active batch files and assigns /30/
  2482. to the current errorlevel.
  2483.  
  2484. ------------------------------------------------------------------------
  2485. ------------------------------------------------------------------------
  2486. ------------------------------------------------------------------------
  2487.  
  2488.    1. Introduction <#-intro>
  2489.    2. FreeCOM Command Line Syntax - Useage, Switches and Options
  2490.       <#-cmdline>
  2491.    3. Environment Variables <#-envvars>
  2492.    4. Internal Commands <#-icmds>
  2493.    5. User Prompt <#-userprompt>
  2494.          1. Command Line Syntax <#-cmdline-syntax>
  2495.          2. Command Line Editing <#-cmdline-editing> 
  2496.    6. Features of FreeCOM <#-features>
  2497.    7. Status of FreeCOM / To-do List <#-status>
  2498.    8. Appendix <#-appendix>
  2499.          1. Compile FreeCOM - sample <#-compile>
  2500.          2. Download <#-download>
  2501.          3. CVS Resources <#-cvs-tags>
  2502.          4. EBNF <#-ebnf> 
  2503.  
  2504. ------------------------------------------------------------------------
  2505.  
  2506.  
  2507.   Introduction
  2508.  
  2509. FreeCOM is a:
  2510.  
  2511.     * *C*ommand *L*ine *I*nterface,
  2512.     * (user) shell and/or
  2513.     * COMMAND.COM replacement 
  2514.  
  2515. for DOS. It has been spawned as part of FreeDOS
  2516. <http://www.freedos.org>, a project that aims to implement a GNU GPL'ed
  2517. DOS.
  2518.  
  2519. The main duty of FreeCOM is to prompt the user to enter commands
  2520. <#-userprompt>, which are interpreted, processed directly by FreeCOM or
  2521. executed as executable files.
  2522.  
  2523. Those commands processed by FreeCOM directly are called /Internal
  2524. Commands/ <#-icmds>.
  2525.  
  2526. Non-internal commands, which cannot be processed by FreeCOM directly,
  2527. are called /External Commands/, because FreeCOM will search for files
  2528. equally named as typed-in.
  2529.  
  2530. Besides to implement certain commands FreeCOM offers some features
  2531. <#-features>.
  2532.  
  2533. ------------------------------------------------------------------------
  2534.  
  2535.  
  2536.   Command Line Syntax, Useage, Switches and Options
  2537.  
  2538. COMMAND.COM *[* /path/ *[* /console/ *]* *]* *[{* /option/ *}]* *[* '/'
  2539. *(* K | C *)* ½commandline╗ *]*
  2540.  
  2541. If present, the first non-option argument specifies the location in
  2542. which FreeCOM resides. This location is later stored in the environment
  2543. variable COMSPEC. Since DOS3+ this option is no longer necessary to find
  2544. the shell invoked during the boot process, but it may be used to let the
  2545. system boot a primary shell from one location, but use a shell of the
  2546. same version from a different location later on.
  2547. One shallt not point to a RAMdisk at this time, because FreeCOM needs to
  2548. reload certain information relatively early during execution, before
  2549. AUTOEXEC.BAT had been executed, in which, normally, FreeCOM is copied
  2550. into the RAMdisk.
  2551. For convinience FreeCOM checks, if at the given location a FreeCOM
  2552. exists *and* is accessable, if not, the given location is ignored. Also,
  2553. the standard requires to specify a path only, but FreeCOM accepts an
  2554. absolute filename, so accepting that FreeCOM is not necessarily named
  2555. COMMAND.COM.
  2556.  
  2557. The second non-option argument, if present, specifies the console
  2558. FreeCOM shall enable. This setting is system-wide and is not limited to
  2559. FreeCOM or just this particular process tree. In its result, this
  2560. argument is identical to the CTTY <cmd.html#ctty> command.
  2561.  
  2562. FreeCOM knows the following options:
  2563.  
  2564.     * */?*: Issues a help screen, then exists.
  2565.     * */!*: Enable/disable debugging support, if compiled to FreeCOM.
  2566.     * */Y*: Enables trace/single step mode. This mode is deaktivated
  2567.       when the user prompt has been reached.
  2568.     * */D*: Disables to parse AUTOEXEC.BAT, even if the */P* option is
  2569.       present. This switch is usually set by the kernel, when F5 had
  2570.       been pressed during bootup.
  2571.     * */F*: Enables autofail of Critical Errors; then instead of
  2572.       displaying the Abort/Retry/Ignore/Fail dialog, Critical Errors are
  2573.       automatically answered with Fail.
  2574.     * */P*: Installs a primary copy of FreeCOM. Such instance:
  2575.          1. cannot be terminated with the EXIT <cmd.html#exit> command.
  2576.          2. executes the AUTOEXEC.BAT script before any other command. 
  2577.       The */P* option may have an argument to specify an alternate name
  2578.       for the AUTOEXEC script, e.g.: */P:FDAUTO.BAT*.
  2579.     * */E*: Sets another size of the environment segment, in which all
  2580.       the environment variables are stored, e.g.: */E:1024*.
  2581.     * */L*: Sets the size of the internal command buffer. /Note/: This
  2582.       option is ignored currently, the internal buffer always defaults
  2583.       to 512 bytes.
  2584.     * */U* Sets the size of the internal user input buffer. /Note/: This
  2585.       option is ignored currently. The input buffer always defaults to
  2586.       255 bytes, which is the maximum.
  2587.     * */LOW*: Forces to load FreeCOM low. /Note/: Currently this option
  2588.       has no effect, because no part of FreeCOM is loaded high.
  2589.     * */MSG*: Installs the message server. /Note/: Because the message
  2590.       server is not used nowadays, this option forces to permanently
  2591.       load FreeCOM's messages into memory.
  2592.     * */SWAP*: Toggles, if to default to swapping or not; due to
  2593.       different default values of this /internal/ flag, it is
  2594.       recommended to always prefix the option with '|+|' to enable or
  2595.       '|-|' to disable swapping. 
  2596.  
  2597. The options */K* and */C* are special cases and do not behave as normal
  2598. options does. They are exclusive and all characters at the right side of
  2599. such option (except an optional argument sign) specify a command to
  2600. execute, e.g.: /C DIR <cmd.html#dir> /s, /C=DIR <cmd.html#dir> /s, and
  2601. /CDIR /s do behave exactly the same and execuate the command DIR
  2602. <cmd.html#dir> /s.
  2603. If these options are used in conjunction with the */P* option, the
  2604. AUTOEXEC.BAT script is executed prior executing the specified command.
  2605. In opposite to */K* the */C* option does not enter the interactive shell
  2606. prompt after executing the specified command unless the */P* options is
  2607. present, too.
  2608.  
  2609. Boolean options, which can only be /enabled/ or /disabled/, may be
  2610. prefixed by '|+|' to enable or '|-|' to disable it.
  2611.  
  2612. ------------------------------------------------------------------------
  2613.  
  2614.  
  2615.   Environment Variables
  2616.  
  2617. Environment variables can be freely assigned using the SET
  2618. <cmd.html#set> command, e.g. executing:
  2619. SET <cmd.html#set> var1=tecxsgk;jsdgsdflfsjdflkasjf/lasjflas
  2620.  
  2621. assigns this nonsense to the variable var1. Later on, the value of the
  2622. variable can be used by writing: %var1%, thus, writing the name of the
  2623. variable enclosed without whitespace by two percent signs. *Warning*:
  2624. Environment variables are expanded fully into plain text before the
  2625. command line is furtherly parsed. If a variable contains an odd number
  2626. of quotes, the remaining command line must contain the closing quote in
  2627. order to operate properly. Also see this:
  2628. SET <cmd.html#set> var=text del
  2629. IF <cmd.html#if> text==%var% GOTO <cmd.html#goto> label
  2630.  
  2631. The second line looks uninteresting, but once the environment variable
  2632. has been expanded the line has morphed into:
  2633. IF <cmd.html#if> text==text del GOTO <cmd.html#goto> label
  2634.  
  2635. not that funny anymore, because the IF <cmd.html#if> command interpretes
  2636. only the string text==text as condition, but del GOTO <cmd.html#goto>
  2637. label is executed as command.
  2638.  
  2639. FreeCOM uses a number of environment variables for its own purpose.
  2640.  
  2641.     * *COMSPEC*: FreeCOM loads some information on demand, these data
  2642.       are stored in the FreeCOM executable. The value of this
  2643.       environment variable contains the filename FreeCOM shall use. The
  2644.       contents can be changed with the SET <cmd.html#set> command.
  2645.     * *DIRCMD*: The user may define default values for the DIR
  2646.       <cmd.html#dir> command. Any options specified within DIRCMD are
  2647.       prefixing any entered ones, so to say FreeCOM behaves as if the
  2648.       user always types:
  2649.       DIR <cmd.html#dir> %DIRCMD% ½other arguments╗
  2650.  
  2651.       This variable must be changed using the SET <cmd.html#set> command.
  2652.     * *COPYCMD*: This variable contains default options for the COPY
  2653.       <cmd.html#copy> command.
  2654.     * *PROMPT <cmd.html#prompt>*: FreeCOM prompts the user to enter
  2655.       commands to run, the prompt can be customized by changing the
  2656.       contents of this variable.
  2657.       This variable can be changed using the SET <cmd.html#set> or the
  2658.       PROMPT <cmd.html#prompt> commands. Latter one includes a detailed
  2659.       description of the format of the prompt string.
  2660.     * *PATH <cmd.html#path>*: When FreeCOM is to execute an external
  2661.       command and this one does not contain no path, FreeCOM searched
  2662.       for the command in a number of paths. These ones are enumerated by
  2663.       the PATH <cmd.html#path> environment variable.
  2664.       This variable can be changed using the SET <cmd.html#set> or the
  2665.       PATH <cmd.html#path> commands. Latter one includes a detailed
  2666.       description of the format of the search path. 
  2667.  
  2668. There are a number of automatic variables that do not follow the above
  2669. mentioned syntax and which contents is automatically generated. Unlike
  2670. the normal variables these automatic variables are constructed of
  2671. exactly two characters, the first one is a single percent sign and the
  2672. second one the variable identifier:
  2673.  
  2674.     * *%?*: expands to the current errorlevel, which is the exit code of
  2675.       the previously executed external command.
  2676.     * *%0*: in batch scripts only: is the name of the script currently
  2677.       executed.
  2678.     * *%1* through *%9*: in batch scripts only: are the first through
  2679.       nineth argument passed to the currently executed batch script. If
  2680.       less than nine arguments had been passed to the script, they
  2681.       return an empty string. To access the tenth argument please refer
  2682.       to the SHIFT <cmd.html#shift> command.
  2683.     * FOR <cmd.html#for> *%v* IN (...) DO ½any command╗: *%v* may use
  2684.       any letter, the FOR <cmd.html#for> command creates a new variable,
  2685.       which is valid in the ½any command╗ following the DO keyword.
  2686.     * *%%*: Is no real variable, but expands to a single percent sign. 
  2687.  
  2688. Because automatic variables have one percent sign only, it sometimes
  2689. lead to confusion within the FOR <cmd.html#for> command, e.g. in:
  2690. SET <cmd.html#set> adam=eva
  2691. FOR <cmd.html#for> %a in (*.*) DO echo %adam% %a
  2692.  
  2693. %adam is interpreted as [%a]dam.
  2694.  
  2695. ------------------------------------------------------------------------
  2696.  
  2697.  
  2698.   Internal Commands
  2699.  
  2700. Internal commands will be processed by FreeCOM directly, they are
  2701. available to the user without presence of any external files, in fact
  2702. they hide External Commands named equally.
  2703.  
  2704. The synopsises of the internal commands <cmd.html> are described in a
  2705. style derived from EBNF <#-ebnf>.
  2706.  
  2707. ------------------------------------------------------------------------
  2708.  
  2709.  
  2710.   User Prompt
  2711.  
  2712. FreeCOM knows two modes:
  2713.  
  2714.    1. Interactive, and
  2715.    2. batch processing. 
  2716.  
  2717. The second one performs batch scripts, which are more or less a sequence
  2718. of commands written to a file. Such files may contain any external
  2719. commands, internal commands and calls to other batch files as well.
  2720.  
  2721. In interactive mode FreeCOM prompts the user to enter a command, the
  2722. line is interpreted, parsed and, finally, either rejected because of an
  2723. error or executed.
  2724.  
  2725.  
  2726.     Command Line Syntax
  2727.  
  2728. FreeCOM accepts the following command line:
  2729. *[* ':' *]* *[* '?' *]* *[* '@' *]* *[* '*' *]* *{* /command/ *[{*
  2730. /argument/ | /redirection/ *}]* *:* '|' *}*
  2731. /redirection/ *::=* *(* '<' | '>' | '>>' *)* /filename/
  2732.  
  2733. The first optional ? must not be mixed up with the command ?!
  2734.  
  2735.  
  2736.       Description:
  2737.  
  2738. The colon marks the line as label, which causes to let FreeCOM ignore
  2739. the line completely as no interpretation is tried on this line, neiter
  2740. are any redirections <cmd.html#_appendix_redirection> created.
  2741.  
  2742. The ? forces FreeCOM to enable the trace mode for this line. In trace
  2743. mode FreeCOM prompts the user wether to execute the resulting command.
  2744.  
  2745. The optional @ disables the echo status for this line. If the echo
  2746. status is enabled, the line is displayed right before it is executed;
  2747. see ECHO <cmd.html#echo> for more details.
  2748.  
  2749. The asterisk * is available only, if aliases are compiled into FreeCOM;
  2750. if present, the alias expansion <#-features> is skipped.
  2751.  
  2752. If commands are chained with the | symbols, those commands are to be
  2753. executed as a /pipe/. For instance the command line:
  2754. cmd1 | cmd2 | cmd3
  2755.  
  2756. forms a pipe consisting of the three individual commands cmd1, cmd2, and
  2757. cmd3, where the standard output stream of cmd1 is connected to the
  2758. standard input stream of cmd2 and the output of cmd2 to the input of
  2759. cmd3. /Note:/ Because DOS is no multitasking environment, pipes are
  2760. simulated with file and the three-command pipe will look like this:
  2761. cmd1 >%TEMP%\cmd###1.tmp
  2762. cmd2 <%TEMP%\cmd###1.tmp >%TEMP%\cmd###2.tmp
  2763. cmd3 <%TEMP%\cmd###2.tmp
  2764.  
  2765. The files are temporary ones and will be removed as soon as they are no
  2766. longer required, meaning the tempfile #1 is removed after cmd2
  2767. terminates and tempfile #2 upon termination of cmd3.
  2768.  
  2769. Redirections tie the standard input or output stream to a file or
  2770. device, for instance:
  2771. cmd arg >outfile
  2772.  
  2773. redirects the standard input stream of cmd to the file infile and the
  2774. standard output stream to outfile. The double output redirection
  2775. specifies to append to an existing file rather than overwriting it.
  2776.  
  2777.  
  2778.     Command Line Editing
  2779.  
  2780. FreeCOM offers two methods to interactively enter command lines:
  2781.  
  2782.    1. standard input, and
  2783.    2. enhanced input. 
  2784.  
  2785. The first one just calls a DOS function, whereas the second one
  2786. processes each key for its own. Which method FreeCOM uses is defined at
  2787. compile time.
  2788.  
  2789. If the echo state is enabled, the user is /prompted/ with the PROMPT
  2790. <cmd.html#prompt> string; otherwise no visible or audible prompt is
  2791. issued to indicate an user activity request.
  2792.  
  2793. In either mode the ENTER key terminates the editing and lets FreeCOM
  2794. start to interprete the entered line.
  2795.  
  2796. The *standard input* mode does neither support command line history,
  2797. except the last command line in some circumstances, nor file completion.
  2798. The following keys have a special meaning:
  2799. Key Meaning
  2800. F1 Get next character from last line, if available
  2801. F3 Get last line, if available
  2802. F5 Place current line in last-line buffer and restart editing on a blank
  2803. line
  2804. F6 Insert the pseudo-character /End-of-file/
  2805. backspace delete character to the left
  2806. cursor left delete character to the left
  2807. cursor right Get next character from last line, if available
  2808.  
  2809. The *enhanced input* mode does support command line history and file
  2810. completion. The following keys have a special meaning:
  2811. Key Meaning
  2812. F1 Get next character from last line, if available
  2813. F3 Get last line, if available
  2814. F5 Place current line in last-line buffer and restart editing on a blank
  2815. line
  2816. backspace delete character to the left
  2817. cursor down Replace the current input line with the previous line from
  2818. the history
  2819. cursor left move cursor one character one position to the left
  2820. cursor right Move cursor one position to the right; at the end of the
  2821. line get next character from last line, if available
  2822. cursor up Replace the current input line with the next line from the
  2823. history
  2824. delete Deletes the character on the cursor
  2825. end Moves the cursor to the end of the line
  2826. ESC Clear current line
  2827. home moves the cursor to the beginning of the line
  2828. insert Switch between insert and overwrite mode
  2829. TAB Take the current word for a file and try to complete it
  2830. ^C Clear current line and enable echo state. The echo state is enabled
  2831. to ensure the user gets to know he is on the command line of FreeCOM
  2832. rather than stuck in a non-interruptable program.
  2833.  
  2834. ------------------------------------------------------------------------
  2835.  
  2836. ------------------------------------------------------------------------
  2837.  
  2838.  
  2839.   Features of FreeCOM
  2840.  
  2841. FreeCOM implements the following features:
  2842.  
  2843.     * <cmd.html_aliases>FEATURE_ALIASES <cmd.html#feature_aliases> -
  2844.       Command aliases
  2845.     * <cmd.html_auto_redirect_to_con>FEATURE_AUTO_REDIRECT_TO_CON
  2846.       <cmd.html#feature_auto_redirect_to_con> - Autoswitch CON: to monitor
  2847.     * <cmd.html_batch>FEATURE_BATCH <cmd.html#feature_batch> - Batch
  2848.       script processing
  2849.     * <cmd.html_boot_keys>FEATURE_BOOT_KEYS <cmd.html#feature_boot_keys>
  2850.       - check for F5/F8 keys on startup if /P is present
  2851.     * <cmd.html_call_logging>FEATURE_CALL_LOGGING
  2852.       <cmd.html#feature_call_logging> - Startup logging
  2853.     * <cmd.html_dirstack>FEATURE_DIRSTACK <cmd.html#feature_dirstack> -
  2854.       Directory stack
  2855.     * <cmd.html_enhanced_input>FEATURE_ENHANCED_INPUT
  2856.       <cmd.html#feature_enhanced_input> - Enhanced command line editing
  2857.     * <cmd.html_filename_completion>FEATURE_FILENAME_COMPLETION
  2858.       <cmd.html#feature_filename_completion> - Filename completion
  2859.     * <cmd.html_history>FEATURE_HISTORY <cmd.html#feature_history> -
  2860.       Command line history
  2861.     * <cmd.html_installable_commands>FEATURE_INSTALLABLE_COMMANDS
  2862.       <cmd.html#feature_installable_commands> - Installable Commands
  2863.       interface (MUX-AE)
  2864.     * <cmd.html_last_dir>FEATURE_LAST_DIR <cmd.html#feature_last_dir> -
  2865.       Change back to last directory
  2866.     * <cmd.html_load_messages>FEATURE_LOAD_MESSAGES
  2867.       <cmd.html#feature_load_messages> - Load messages permanently
  2868.     * <cmd.html_nls>FEATURE_NLS <cmd.html#feature_nls> - use DOS NLS 
  2869.  
  2870. ------------------------------------------------------------------------
  2871.  
  2872.  
  2873.   Status of FreeCOM
  2874.  
  2875. FreeCOM's development currently targets the v1.0 version, which is to
  2876. provide all functionality (features) of commonly known COMMAND.COMs at
  2877. minimum, but probably at the cost of optimization and performance.
  2878.  
  2879. The To-Do list:
  2880. Feature Target
  2881. Swapping without any supporting secondary programs (KSSF.COM and
  2882. VSPAWN.COM) v0.90
  2883. INT-2E backdoor v0.90
  2884. Wildcards for REN <cmd.html#ren>, same filename pattern matching code
  2885. for REN <cmd.html#ren>, COPY <cmd.html#copy> and DIR <cmd.html#dir> v0.93
  2886. DIR <cmd.html#dir> /O and DIR <cmd.html#dir> /A v0.93
  2887. IF <cmd.html#if> /I v0.85
  2888. Input/output functions to replace <stdio.h> by <io.h> (aka replace
  2889. FILE*-based I/O by handle-based one) v0.95 <#-todo1>
  2890. Strict error recognition, probably _doserrno based v0.97 <#-todo1>
  2891. Support for DOS=HIGH v0.90
  2892. Code sharing of modules v0.91
  2893. Full support for DOS NLS pre v0.95
  2894. Redirection in conjunction with Swapping v0.90
  2895. Optimize FreeCOM for size >= v1.0
  2896. Other swap storage areas, e.g. XMS and EMS post v1.0 <#-todo2>
  2897. Long filenames post v1.0
  2898. internal commands <#-icmds> mostly done <#-icmds>
  2899. Aliases: ALIAS <cmd.html#alias> done
  2900. Command line history: HISTORY <cmd.html#history> done
  2901. Directory stack: DIRS <cmd.html#dirs>, PUSHD <cmd.html#pushd>, and POPD
  2902. <cmd.html#popd> done
  2903. MUX-AE interface done
  2904. Enhanced command line editing, file completion <#-cmdline-editing> done
  2905. Last directory recognition: CD <cmd.html#cd>, CDD <cmd.html#cdd>, PUSHD
  2906. <cmd.html#pushd> done
  2907. Control Break handler done
  2908. Critical Error handler done
  2909. IF <cmd.html#if> ERRORLEVEL H/<letter>/ done (v0.83?48)
  2910.  
  2911.  
  2912. Footnotes:
  2913.  
  2914.     * I/O replacement shallt preceed error reporting correction as some
  2915.       failures are impossible to detect without work-arounds with the
  2916.       <stdio.h> functions.
  2917.     * If I get contributions after v0.90, those portion may be added
  2918.       earlier. 
  2919.  
  2920. ------------------------------------------------------------------------
  2921.  
  2922.  
  2923.   Appendix
  2924.  
  2925.  
  2926.     Compile FreeCOM - sample
  2927.  
  2928. Due to heavy request, there is a sample description how to compile
  2929. FreeCOM in ten steps <build48.html>.
  2930.  
  2931.  
  2932.     Download
  2933.  
  2934. FreeCOM can be downloaded from SourceForge in several ways and packages:
  2935.  
  2936.    1. source code files from the CVS repository <#-cvs-tags>
  2937.    2. tarball and pre-compiled packages from anonymous FTP <#-download-ftp>
  2938.    3. tarball and pre-compiled packages via HTTP <#-download-http>
  2939.    4. tarball and one pre-compiled package as file release
  2940.       <#-download-filerelease> 
  2941.  
  2942.  
  2943.       Resources accessable via anonymous FTP
  2944.  
  2945. SourceForge closed the FTP - Services, therefore an alternate location
  2946. had been created at:
  2947. ftp://ftp-fd.inf.fh-rhein-sieg.de/pub/freedos/local/FreeCOM. It contains
  2948. the very same packages available at the HTTP location below.
  2949.  
  2950.  
  2951.       Resources accessable via HTTP
  2952.  
  2953. http://freedos.sourceforge.net/freecom/packages/ contains several
  2954. variants of tarballs and pre-compiled packages of FreeCOM. The files
  2955. immediately located in the directory contain the most current major
  2956. release of FreeCOM, whereas the subdirectories include Beta releases of
  2957. the upcoming release.
  2958.  
  2959. The packages themselves include:
  2960. file name contents
  2961. COM###.ZIP or Com###Beta##.ZIP tarball (the source code tree without CVS
  2962. information)
  2963. BINARY.ZIP the most commonly used pre-compiled FreeCOM with almost any
  2964. feature, but debugging enabled.
  2965. This release uses standard swapping mechanisms!
  2966. XMSSWAP.ZIP the most commonly used pre-compiled FreeCOM with almost any
  2967. feature, but debugging enabled.
  2968. This release uses XMS-Only swapping mechanism!
  2969. PLAINEDT.ZIP As BINARY.ZIP but using the plain command line editor of
  2970. the kernel instead of the enhanced one
  2971. DEBUG.ZIP As BINARY.ZIP with debugging support enabled.
  2972. This variant is a lot larger than the standard release and can generate
  2973. lots of output.
  2974. LOCALIZE.ZIP As BINARY.ZIP but targetted at maintainers of a language
  2975. description file (*.LNG).
  2976. SUPPL.ZIP the SUPPL library required for linking FreeCOM precompiled for
  2977. use with Turbo C++ v1.01
  2978. DOCS.ZIP a package with these HTML documents
  2979.  
  2980.  
  2981.       File Releases on SourceForge
  2982.  
  2983. On SourceForge <http://sourceforge.net/file/?group_id=5109> so-called
  2984. /File Releases/ can be created. The file release section of the FreeCOM
  2985. module contains a source ZIP and a binary ZIP file, they are equal to
  2986. the tarball and the BINARY.ZIP on the anon FTP space respectively.
  2987. Unlike the FTP space, old versions are kept, but no Beta versions or
  2988. side branches.
  2989.  
  2990.  
  2991.     CVS Resources
  2992.  
  2993. On SourceForge <http://sourceforge.net/project/?group_id=5109> a short
  2994. description of how to access the CVS repository is located. Following
  2995. those instructions will download the main trunk of the specified module
  2996. of the repository, e.g.:
  2997.  
  2998. cvs -z6 co freecom
  2999.  
  3000. downloads the MAIN trunk, also called HEAD, of FreeCOM.
  3001.  
  3002. Alternatively the WebCVS -- follow the Browse CVS link there -- might be
  3003. helpful in order to download a handful of files.
  3004.  
  3005. However, CVS allows to branch the development of a module at some point
  3006. from the main trunk into side trees. On these branches the module can be
  3007. developed further, new features can be added etc., without disturbing
  3008. the main trunk (and therefore the primary release) of the module. When
  3009. the side development proved its worthiness, the changes are merged into
  3010. the main trunk and, hence, becomes part of the primary release.
  3011.  
  3012. Branches are marked by tags, though, unlike normal tags branch tags
  3013. automatically evolve with the file, what means that when a file from a
  3014. specific branch is updated, the branch tag automatically move from the
  3015. current version of the file to the new one.
  3016. To check out a branch, create a new directory, change within it and
  3017. execute:
  3018.  
  3019. cvs -z6 co -r tag freecom
  3020.  
  3021. , where tag is the name of the branch you want to download. /Note/: It
  3022. is not advisable to use the same directory to manage files for two
  3023. different branches.
  3024.  
  3025. The FreeCOM module has the following /active/ branches:
  3026.  
  3027. Tag Meaning
  3028. expExec Stack-based execution context implementation
  3029. expSpawn Module based FreeCOM, bases on expRes branch
  3030.  
  3031. The FreeCOM module has the following /obsoleted/ branches:
  3032.  
  3033. Tag Meaning
  3034. expRes Resource management implementation.
  3035. Finally merged into trunk as of 2001/03/10
  3036.  
  3037. ------------------------------------------------------------------------
  3038.  
  3039.  
  3040.     EBNF
  3041.  
  3042. Documents encode the synopsis of the commands with operators derived
  3043. from EBNF (*E*xtended *B*ackus-*N*aur *F*ormula).
  3044.  
  3045.  
  3046.       Type setting
  3047.  
  3048. Depending on different meanings characters are set into various shapes:
  3049. Name Meaning Example
  3050. terminal characters to be enterred on command line or displayed by the
  3051. computer;EBNF: "terminal symbols" ECHO <cmd.html#echo>
  3052. 'string' The quotes remove the metafunction of the enclosed characters
  3053. in order to specify EBNF operators as terminal symbols. EBNF: "terminal
  3054. symbols" '|'
  3055. *bold* operators that constructs portions together; EBNF: "operators" *|*
  3056. /italic/ placeholders for arguments, which are explained in the
  3057. description; EBNF: "non-terminal symbols" /varname/
  3058.  
  3059.  
  3060.       Operators
  3061.  
  3062. The EBNF uses the following operators:
  3063. Symbol Meaning
  3064. *|* alternative; use either left or right token
  3065. *()* parenthizes enclose tokens limiting the range of *|*
  3066. *[]* brackets enclose optional tokens, thus, they may appear zero or one
  3067. time; they also limit the range of *|*
  3068. *{}* curly brackets enclose repitive tokens, which may appear one or
  3069. more times; they also limit the range of *|*
  3070. *{ : }* as the normal curly brackets, but any repitive tokens are
  3071. delimited by the token(s) right of the colon; for instance:
  3072.  
  3073.     *{* /file/ *:* '+' *}* 
  3074.  
  3075. is the same as:
  3076.  
  3077.     /file/ *[{* '+' /file/ *}]* 
  3078.  
  3079. and applies to:
  3080.  
  3081.     * /file/
  3082.     * /file/ + /file/
  3083.     * /file/ + /file/ + /file/
  3084.     * /file/ + /file/ + /file/ + /file/
  3085.     * ... 
  3086.  
  3087. *½ ╗ * is a placeholder for an arbitary string of terminal symbols,
  3088. which further syntax is described by the enclosed text in English
  3089. natural language.
  3090. *::=* assigns a meaning (right side) to a non-terminal symbol (left
  3091. side); for instance
  3092.  
  3093.     DIR <cmd.html#dir> *[ {* /option/ *|* /filespec/ *} ]*
  3094.     /option/ *::=* / *(* A *|* B *|* C *)*
  3095.  
  3096. Any occurance -- only one here -- of /option/ on the right side of an
  3097. *::=* or where no *::=* is present at all is to be replaced by the right
  3098. side of /option/*::=*.
  3099.  
  3100. Unless modified by above mentioned operators a sequence of tokens
  3101. specifies that each token must be present exactly one time in exactly
  3102. that order.
  3103. Note: For the sake of clearness, spaces are inserted between tokens.
  3104. These spaces do *not* mean that a space is allowed at this place! Also,
  3105. the fact that no *_* is present does *not* mean that at this place is
  3106. none allowed. It is assumed that the reader will find the places where
  3107. optional spaces are valid either by "doing" or by reading the examples.
  3108.  
  3109. ------------------------------------------------------------------------
  3110. ------------------------------------------------------------------------
  3111. ------------------------------------------------------------------------
  3112. ------------------------------------------------------------------------
  3113.  
  3114. Copyright 2000-2001 ⌐ Steffen Kaiser - current maintainer of FreeCOM
  3115.  
  3116. Elvis - The VI clone <ftp://ftp.cs.pdx.edu/pub/elvis/>
  3117.  
  3118.