This is a DOS/DJGPP port of GNU Bash 2.03. This document covers issues
specific to DJGPP. 

Contents
========

1. Installing the binary
2. DJGPP port specific changes
3. DJGPP port specific changes from 1.14.7
4. Building from sources
5. Thanks

Installing the binary
=====================

Unzip the binary package with the option to preserve directories 
(the -d option in PKUNZIP, the -directories option in PKZIP 2.5)
from the top of your DJGPP directory tree.

To add a menu item for Bash to Info's default menu listing, run
instinfo.bat in the gnu/bash-2.03/dos directory.

You should at the very least read README, NEWS, and CHANGES. If you are
from Bash 1.14.7, I also recommend you read COMPAT to learn about the
incompatibilities between 1.14.7 and 2.03.

If you will be using Bash to build GNU packages or other any packages that
assume the presence of Unix utilities, you should also download and install
Fileutils, Textutils, Sh-utils, Grep, Diffutils, Findutils, Sed, and Gawk.

DJGPP port specific changes
===========================

* TMPDIR environment variable:
  Contains the directory where temporary files will be stored. This must
  point to an existing directory or Bash will abort with an error
  message on startup. If 'TMPDIR' does not exist, Bash will then check
  'TEMP', 'TMP'. If none of those variables are defined, or if they all
  point to a directory that don't exist, then 'c:/tmp' or 'c:/' will be
  will be used as the temporary directory. The temporary directory must be
  on a writable device like a hard drive or a RAM disk, and not on a
  read-only device like a CD-ROM drive. Otherwise, features that rely
  on temporary files like piping and command substitution won't work
  and will cause Bash to quit with such error messages as "bad piping"
  or "cannot make pipe for process substitution". Bash will set TMPDIR
  to the temporary directory it finds, so type 'echo $TMPDIR' to
  print the directory it found.

* PATH_SEPARATOR variable (default is ';'):
  Contains the character that separates path elements in the environment
  variables PATH, CDPATH, HOME, PWD, OLDPWD, MAILPATH. When not set or
  set to ';', paths are not changed. When set to ':', the paths are stored
  in the form '/dev/x/dir/file' where 'x' is a drive letter. The paths in
  the affected variables are always translated back to DOS style
  drive letter format and separated by ';' for all external programs
  called by Bash.

* SYSROOT variable (deprecated):
  Contains the root directory, or starting point, for pathname searches
  beginning with '/'. When not set, the root directory is the root
  of the drive in the current working directory. Always use absolute paths
  like 'c:/djgpp' or '/dev/c/djgpp' since important variables like PATH are
  adjusted to be relative to the root. Other than to minimize the visibility
  of drive letters, do not bother setting this variable.

  Now that SYSROOT no longer serves a useful purpose; therefore, it will be
  removed from the next official port.

* Automatic conversions with SYSROOT and PATH_SEPARATOR:
  Inside COMMAND.COM:
  PATH=D:\ALPHA\BIN;C:\DJGPP\BIN;C:\BIN;C:\MULE2\BIN

  Inside bash.exe (by default):
  PATH=D:/ALPHA/BIN;C:/DJGPP/BIN;C:/BIN;C:/MULE2/BIN

  Inside bash.exe (when SYSROOT=c:):
  PATH=D:/ALPHA/BIN;/DJGPP/BIN;/BIN;/MULE2/BIN

  Inside bash.exe (when SYSROOT=c: and PATH_SEPARATOR=:):
  PATH=/dev/D/ALPHA/BIN:/DJGPP/BIN:/BIN:/MULE2/BIN

  Note that child process always gets the COMMAND.COM style. This feature
  affects PWD, OLDPWD, HOME, PATH, CDPATH, MAILPATH.

* PATH_EXPAND variable (default is 'N'):
  If set to 'Y' and if SYSROOT contains a directory, a path that begins with
  '/' in an external command will have the value of SYSROOT substituted
  in place of the '/'. This function might be removed from Bash 2.04.

* TEST_FINDS_EXE variable (default is 'N'):
  Along with PATH_SEPARATOR and PATH_EXPAND, helps configure scripts
  run as-is without having to edit them or regenerate them with
  the DJGPP version of Autoconf.If TEST_FINDS_EXE is set to 'y' or 'Y'
  and if 'test -f' fails to find the file and if the file has no extension
  and if the path to the file is absolute, then the test is retried with
  '.exe' added to the filename. This variable should *only* be used when
  configuring a package and is not on by default.

* Drive names are handled correctly.

* Executables are found by searching for extensions in this order:
  .com, .exe, .bat, .btm, .sh, .ksh, .pl, .sed
  ls -> ls, ls.com, ls.exe, ls.bat, ls.btm, ls.sh, ls.ksh, ls.pl, ls.sed

* Bash startup/shutdown files have SFN alternatives:
  ~/.inputrc       ->  ~/_inputrc         (startup file for readline)
  ~/.profile       ->  ~/_profile
  ~/.bashrc        ->  ~/_bashrc          (startup file for bash.exe)
  ~/.bash_profile  ->  ~/_bash_profile
  ~/.bash_profile  ->  ~/_bprof
  ~/.bash_login    ->  ~/_bash_login
  ~/.bash_login    ->  ~/_blogin
  ~/.bash_logout   ->  ~/_bash_logout
  ~/.bash_logout   ->  ~/_blogout

  The LFN version always will be searched before the SFN alternative.

* The arrow keys have been enabled.
  See _inputrc in djgpp directory. Thanks to Jerzy Witkowski.

  Prefixes:
    \e[   Keys without SHIFT, CTRL, or ALT.
    \e[1  With SHIFT key
    \e[2  With CTRL key
    \e[3  With ALT key

  Suffixes:
    A  Up				G  Home
    B  Down                             H  End
    C  Right                            I  Page Up
    D  Left                             J  Page Down
    E  Ins				X  (reserved for function keys)
    F  Del

    XA  F1				XG  F7
    XB  F2				XH  F8
    XC  F3				XI  F9
    XD  F4				XJ  F10
    XE  F5				XK  F11
    XF  F6				XL  F12

  (e.g.)
    F1 key          ->  \e[XA
    CTRL + F10 key  ->  \e[2XJ
    Up arrow key    ->  \e[A

  Default arrow key bindings:
    "\e[A": previous-history
    "\e[B": next-history
    "\e[C": forward-char
    "\e[D": backward-char

* The default name of the Bash history file is '_bhist'.

* Sample _inputrc, _bashrc, _blogin, and _blogout files are included
  in the gnu/bash-2.03/dos directory. Copy the ones you wish to use to the directory
  specified by HOME so Bash can find them. You should probably at least
  copy _inputrc so the "Insert", "Delete", etc. keys will work.

* The script `rundos.sh' in can be used to execute .bat, .com, and other
  DOS/Windows programs which don't understand forward slashes, from
  inside bash.  The script converts forward slashes to backslashes,
  and undoes the effect of the SYSROOT variable, so that the pathnames
  passed to DOS programs are complete and correct.  From bash, type
  "rundos foo arguments..." to execute the program `foo'.

* If you use GNU Info, run the batch file `instinfo.bat' to install the
  dir-entry for bash into the top-level `dir' file of your system.

* The file 'diffs.dos' in bsh203s.zip contains the changes made to the
  official source distribution for the DJGPP port.

DJGPP port specific changes from 1.14.7
=======================================

* Bash is no longer confused by mixed EOL types in shell scripts.
* If a search for a command in either the '/bin' or '/usr' directories fail,
  the PATH will be searched too.
* _bhist is now the default filename for saving the history.
* The unshifted encodings for the arrow keys were changed to values
  compatible with GNU Readline.
* The exit code from a subshell is now returned to the parent.

Building from sources
=====================

You will need:

* a Bash binary
* the GCC compiler and binutils
* rm, ln, mv, cp, and possibly others from the Fileutils
* sed
* cmp from Diffutils
* DJGPP v2.03 or later

Unzip the source archive with the option to preserve directories 
(the -d option in the old PKUNZIP, the -directories option in newer
versions of PKZIP) from the top of your DJGPP directory tree. Install
the Bash binary and required utilities if you haven't already done so.

Normally, you would have to run 'configure' before building GNU packages.
But the DJPPP port already includes the files generated by 'configure',
so you don't have to. However, because of a quirk in Bash's configuration,
you will need to run 'configure' if you extract the archive outside of
the DJGPP directory tree. If you do run 'configure', you need all the
GNU utilities normally required (which is pretty much all of them actually).

To build, run 'sh build.sh'. This requirement is a holdover from the
previous port of Bash and will be eliminated in the next port. You can
change the flags used when compiling by changing the CFLAGS line
in build.sh.

Thanks
======

Thanks to Daisuke Aoyama for his work in porting Bash 1.14.7. Without it,
this port wouldn't be possible. Thanks to Eli Zaretskii, Jeff Williams,
Robert van der Boon, Michel de Ruiter, and everyone else for finding
and reporting bugs they found.
