/*------- bash-2.05a for OS/2 Tue, 29 Jan 2002 00:05:33 +0900 -------*/ ** ** **** **** ***** ***** *** *** *** *** *** *** *** *** *** **** ***** *** * *** *** *** ****** ** *** ** *** *** ****** **** **** *** *** ** ** ***** **** *** **** *** *** ** * *** *** *** *** *** *** * *** *** *** *** **** ***** *** *** *** *** ** *** ***** *** *** *** *** ** *** ****** *** *** *** *** ** *** ***** *** *** *** ** *** *** * *** *** *** *** *** *** *** * ** *** *** *** ** **** **** * ** ** *** *** **** ** ****** **** *** ** *** *** ***** **** ** * **** ******* ****** version 2.05a for OS/2 I have solved some problems existed in older version (2.03 to 2.04). Note that this copy of bash is only for testing. Until `official' release of OS/2 ported bash, please try and test it. If you have any questions and suggestions, please E-mail me. SAWATAISHI JUN, YOKOHAMA JAPAN http://www2s.biglobe.ne.jp/~vtgf3mpr/indxos2.htm Installation ============ Be sure that you have installed ncurses version 5.2 modified by me. http://homepage1.nifty.com/jsawa/gnu/ncurses-5.2.zip [460 kb] Here I assume: HOME directory is "x:/emx" INFOPATH env. var. contains "x:/usr/share/info" MANPATH env. var. contains "x:/usr/share/man" PATH env. var. contains "x:/usr/bin" x:/tmp> unzip -o SOMEWHERE/bash-2.05a.zip x:/tmp> unzip -o OS2tree -d x:/ Before unzipping dot files ( .bash*, .input*) into your HOME directory, you should backup them if you have ones. x:/tmp> unzip -o rc_flies -d x:/emx If UNIXROOT env. var. is "x:", you don't have to set TERMINFO env. var. because staticaly linked ncurses version 5.2 modified by me searches for $UNIXROOT/usr/share/terminfo as terminfo directory. Setup your environment ===================== Note: `~/' represents a HOME directory specified by HOME env. var. 1) Edit `x:/usr/bin/runbash.cmd' according to your environment 2) Correct or delete some lines of `~/.bashrc' export HOME=x:/emx export CDPATH=".;x:/emx/;x:/usr;" export TMP='h:/tmp' export TEMP='h:/tmp' export TMPDIR='h:/tmp' ................... This file reads `~/.bash_alias', `~/.bash_complete.ianmac', `~/.bash_functions_forOS2', and `~/.bash_useful_functions'. You should read these files carefully and correct them if needed. 3) Edit `~/.inputrc_205' included from `~/.inputrc'. - Definition on file viewers specific to file name suffix. SYNTAX: N must be between 0 to 9 set viewer_N COMMAND; SUFFIX_LISTS Max number of SUFFIX_LIST is 64. set viewer_0 less; .txt.gz .txt.bz2 .doc.gz .doc.bz2 set viewer_1 lynx; .htm .html $if xBash set viewer_2 ls -l;.zip .lzh .tar.gz .tar.bz2 .tar.z .tgz .tbz .tbz2 .rpm .deb .gz .bz2 .z $else set viewer_2 cmd.exe /c start /win /n /f eff.exe;.zip .lzh .tar.gz .tar.bz2 .tar.z .tgz .tbz .tbz2 .rpm .deb .gz .bz2 .z $endif set viewer_3 viewman; .man .n .[:digit:] .[:digit:].gz .[:digit:].bz2 .[:digit:]x.gz .[:digit:]x.bz2 set viewer_4 info -f; .info .info.gz .info.bz2 $if xBash set viewer_5 xv;.gif .jpg .jpeg .bmp .png $else set viewer_5 cmd.exe /c start /pm /n /f pmview;.gif .jpg .jpeg .bmp $endif NOTE - 1: ~/.inputrc Read GNU readline manual (INFO and MANPAGE format). Here, I describe some important settings. You can choose one of these KANJI modes set kanji-code sjis # set KANJI mode SJIS set kanji-code euc # EUC set kanji-code no # NO To accept 8-bit chars (like KANJI), you may add these lines set convert-meta off set meta-flag on set output-meta on Running bash ============ Execute bash.exe directly or using runbash.cmd OS/2 Note @os2 ========= New features added to this version of OS/2 port is as follows. Applied a patch for Japanese ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Read `/usr/share/doc/bash-2.05a/README.jis'. Bash recognize window size both in VIO mode and in XFree86 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks to Altair-san 's "scrzise.c", window size recognition is now available. "scrsize.exe" included in this package is staticaly linked with "X11.a". Menu-guided completion ~~~~~~~~~~~~~~~~~~~~~~ Using ncurses menu function (linked with ncurses version 5.2, which I have modified), now we can select files/directories from menu. - Show menu window : ALT-i At command line, type "ls x:/usr/", x:/foo> ls x:/usr/ and push ALT-key and `i' simultaneously, or push ESC-key followed by `i'. You will see a menu like this. @--------- 12 possible completions ---------@ +------------------------+ |-x:/usr/ / : 0| | x:/usr/TclTk / : 1| | x:/usr/bin / : 2| | x:/usr/dll / : 3| | x:/usr/doc / : 4| | x:/usr/etc / : 5| | x:/usr/html / : 6| | x:/usr/include / : 7| | x:/usr/lib / : 8| | x:/usr/libexec / : 9| | x:/usr/man / : 10| | x:/usr/share / : 11| | x:/usr/src / : 12| +------------------------+ Move coursor using `j'(Ctrl-n or UpArrow) or `k' (Ctrl-p or DownArrow). If you want to enter "x:/usr/share" directory, push `i'. @--------- 26 possible completions ---------@ +---------------------------------------+ |-x:/usr/share/ / : 0| | x:/usr/share/aclocal / : 1| | x:/usr/share/autoconf / : 2| | x:/usr/share/automake / : 3| # '/' -- directory | x:/usr/share/dict / : 4| # '*' -- file | x:/usr/share/doc / : 5| | x:/usr/share/emacs / : 6| | x:/usr/share/gengetopt / : 7| | x:/usr/share/gettext / : 8| | x:/usr/share/gnome-xml / : 9| | x:/usr/share/groff / : 10| | x:/usr/share/info / : 11| | x:/usr/share/libtool / : 12| | x:/usr/share/locale / : 13| | x:/usr/share/man / : 14| | x:/usr/share/misc / : 15| | x:/usr/share/namazu / : 16| | x:/usr/share/rfc / : 17| | x:/usr/share/sed / : 18| | x:/usr/share/source-highlight / : 19| | x:/usr/share/state / : 20| | x:/usr/share/sylpheed / : 21| | x:/usr/share/texinfo / : 22| | x:/usr/share/tknamazu / : 23| | x:/usr/share/bison.hairy * : 24| | x:/usr/share/bison.simple * : 25| | x:/usr/share/id-lang.map * : 26| +---------------------------------------+ To read "x:/usr/share/bison.simple", move cursor on it and push `l' or `v'. To move directory upward, push `u' or `o'. Pushing a key `h' will show you a help window like below. Note that keys are interpreted case-sensitively. iew a file: l, v Toggle file info mode: @ Show ile type : f Show Env. Vars : $ Change rive: d, : Go nto a directory : i Change directory pword: o, u Jump to the first item: a Jump to the last item: e Next page: PageDown,SPC Previous page: PageUp, b Next item: j, C-n, UP # C-n means pusing CTRL-key and Previous item: k, C-p, DOWN # `n' key, simultaneously. Scroll p menu: C-u Scroll own menu: C-d Move menu left: LEFT(arrow) Move menu right: RIGHT(arrow) Jump to left corner: C-a Jump to right corner: C-e Incremental Search: S, C-s Search : s Search ext : n Search

revious : p - Exiting from menu window : Enter, ESC, or TAB - Entering menu window for drive lists: ALT-m ------ in command line `d' or `:' --- in menu window x:/foo> bar Pushing ALT-key and `m' simultaneously on command line will create menu window for drive lists. @--------- 19 possible completions ---------@ +-------------------------------+ |-C:/ / : 0| | D:/00upload/bash-2.05 / : 1| | E:/ / : 2| | F:/ / : 3| | G:/usr/dll / : 4| | H:/ / : 5| | I:/ / : 6| | J:/ / : 7| | K:/ / : 8| | L:/ / : 9| | M:/ / : 10| | N:/ / : 11| | O:/ / : 12| | P:/GNU / : 13| | Q:/ / : 14| | R:/ / : 15| | S:/ / : 16| | T:/ / : 17| | U:/ / : 18| | Z:/ / : 19| +-------------------------------+ Pushing `$' from menu window or doing like below in command line will create menu window for shell/environment variables. x:/foo> echo $ # type "echo $" followed by # pushing ALT-key and '$' simultaneously @--------- 180 possible completions ---------@ +--------------------------------+ | $A2PS_CONFIG  : 1| | $ADMIN  : 2| | $AUTOSTART  : 3| | $AWK $ : 4| # $ --- environment variable | $AWKPATH $ : 5| | $BASH V : 6| # V --- shell variable | $BASH_ENV $ : 7| | $BASH_NOQUOTEARGS V : 8| | $BASH_VERSINFO V : 9| | $BASH_VERSION V : 10| | $BIBTEX $ : 11| | $BOOKSHELF $ : 12| | $CANNAHOST $ : 13| | $CDPATH V : 14| | $CLASSPATH $ : 15| | $COLUMNS V : 16| | $COMSPEC $ : 17| | $CONFIG_SITE $ : 18| | $CPLUS_INCLUDE_PATH $ : 19| | $C_INCLUDE_PATH $ : 20| | $DAXNLS $ : 21| | $DIRSTACK V : 22| | $DISPLAY $ : 23| | $DISPLAYTYPE $ : 24| | $DOMAIN $ : 25| | $DPATH $ : 26| | $DSPPATH $ : 27| | $EB_SJIS $ : 28| | $EDITOR $ : 29| | $EIDARG V : 30| | $EMACSCPATH $ : 31| |-$EMACSDATA $ : 32| +--------------------------------+ Env. Var. EMACSDATA = 'm:/src/emacs-20.7/etc' => $EMACSDATA $ : 32 XFree86 availability ~~~~~~~~~~~~~~~~~~~~ Older port of bash had some failures in XFree86 for OS/2 a) completion was not work properly Linking with ncurses and disabling VIO mode key recognition fixed this. b) was not able to recognize screen size Using external program `scrsize', bash determine screen size. When bash runs in XFree86, its readline name becomes "xBash". So, you can define XFree86 specific command in your `.inputrc*' or so. (In OS/2 window command line, readline name is "Bash") $if Bash "\C-xv": "echo Bash in VIO mode\C-a \n" $endif $if xBash "\C-xv": "Bash in XFree86 for OS/2" $endif UNIXROOT environment variable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ According to Bash manual: > When Bash is invoked as an interactive login shell, or as a > non-interactive shell with the `--login' option, it first reads and > executes commands from the file `/etc/profile', if that file exists. > After reading that file, it looks for `~/.bash_profile', > `~/.bash_login', and `~/.profile', in that order, and reads and > executes commands from the first one that exists and is readable. The > `--noprofile' option may be used when the shell is started to inhibit > this behavior. To emulate a use of `/etc/profile', UNIXROOT env. var is introduded. $UNIXROOT/etc/profile -- you can do with or without this file. Fixed Problems of older version =============================== OS/2 ported bash 2.00 to 2.03 had a buggy feature on current working directory. I have fixed them. Shell command pwd returns true absolute path ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In older port: $ pwd $ /foo/bar # should be x:/foo/bar $ ls /foo Now $ pwd $ x:/foo/bar Preservation of current directory in each drive ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change drive : Now you can change drive freely without affecting a current directory of drives. Older port of bash was unable to do this. e.g. [c:/] cd os2 [c:/os2] cd g: [g:/] cd usr [g:/usr] cd c: [c:/os2] cd g: [g:/usr] To effectively use this feature, add lines like below to your `.bash_alias' file in your home directory. alias a:='cd a:' alias b:='cd b:' alias c:='cd c:' alias d:='cd d:' alias e:='cd e:' alias f:='cd f:' alias g:='cd g:' alias h:='cd h:' alias i:='cd i:' ......... ......... Useful function for OS/2 users ============================== See ~/.bash_functions_forOS2 - function test properly handles "-x" flag "test -x command" returns true, if command, command.cmd or command.exe exists in PATH directory. $ if test -x ls ; then echo yes ; fi In non-XFree86 command line ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - you can change window size using "chwin" Description: Change Command-line window size in VIO mode Usage : chwin COLUMNS(y) LINES(x) $ chwin 100 50 In XFree86 virtual terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - bash cannot recognize window size when it is changed To determine new window size, execute function "setwinsize" or "setwin" . After doing this, command like "ls.exe" will properly display results. Some new features of bash since version 2.01 ============================================ Here I describe some new functions of latest version of Bash. I have already defined keys for these functions in `.inputrc_205' included in ZIP archive. completion-ignore-case' If set to on', Readline performs filename matching and completion in a case-insensitive fashion. The default value is off'. menu-complete ()' Similar to complete', but replaces the word to be completed with a single match from the list of possible completions. Repeated execution of menu-complete' steps through the list of possible completions, inserting each match in turn. At the end of the list of completions, the bell is rung and the original text is restored. An argument of N moves N positions forward in the list of matches; a negative argument may be used to move backward through the list. This command is intended to be bound to TAB', but is unbound by default. I recommend you to add following lines to your `~/.inputrc'. "\C-i": menu-complete # TAB key or CTRL + i set completion-ignore-case on Required Executables @req ==================== HOBBES=ftp://hobbes.nmsu.edu/pub/os2 LEO=ftp://ftp.leo.org/pub/comp/os/os2/leo JSAWA=http://www2s.biglobe.ne.jp/~vtgf3mpr emx runtime version 0.9d (or later): Not included HOBBES/dev/emx/v0.9d/emxrt.zip LEO/dev/emx/v0.9d/emxrt.zip `man' (requires GNU groff) HOBBES/dev/help/gnuman.zip ; v1.0 LEO/gnu/doc/man11a.zip ; v1.1a JSAWA/linux/man.htm ; v1.5g GNU texinfo v4.0 (strongly modified version) to read Info manuals - This can be run both in VIO mode and in XFree86 terminals - Support 7 kind of language including Japanese for message - Support Info manual written in 8-bit code including Japanese JSAWA/gnu/texinfo.htm [English] JSAWA/jpinfo.htm [Japanese] ( GNU texinfo v3.11 LEO/gnu/doc/gnuinfo.zip HOBBES/apps/wp/tex/util/gnuinfo.zip ) GNU groff -- to read manpages Groff v1.10 HOBBES/apps/wp/gnugroff.zip LEO/gnu/doc/gnugroff.zip GNU groff v1.15 (with Japanization patch) JSAWA/manpage/manpage-e.htm [English] JSAWA/manpage/manpage.htm [Japanese] GNU grep (grep.exe) HOBBES/util/file/gnugrep.zip ; v2.0 LEO/gnu/systools/gnugrep.zip ; v2.0 JSAWA/gnu/grep.htm ; v2.3h or later Pager : I strongly recommend you to install `less' less 332 with Japanese patch: http://hp.vector.co.jp/authors/VA000199/os2/ You can use this in virtual terminal (xterm etc) of XFree86 for OS/2. You should get this one if you'd like to see manpages in XFree86. less 329 without XFree86 capability LEO/unix/gnu/less329-2.zip HOBBES/unix/util/util/file/less329-2.zip `gzip.exe' and `bzip2.exe' [gzip] HOBBES/util/archiver/gz124_32.zip LEO/gnu/archiver/gz124-32.zip [bzip2] HOBBES/util/archiver/bzip090b.zip LEO/archiver/bzip090b.zip http://www.muraroa.demon.co.uk/ JSAWA/rpm/bzip2.htm ; v0.9.5d --- this version preserve time stamp http://netpassport-wc.netpassport.or.jp/~wmakoto/CLUB-bzip2.html GNU Awk (gawk.exe) [English version] HOBBES/dev/awk/gnuawk.zip ; v3.0.3 [Japanized version] JSAWA/gnu/awk.htm ; v3.0.4 GNU find (find.exe) LEO/gnu/systools/gnufind.zip ; v4.1 HOBBES/util/disk/gnufind.zip ; v4.1 GNU sed LEO/gnu/systools/gnused.zip ; v2.05 HOBBES/apps/editors/gnused.zip ; v3.0 JSAWA/gnu/sed.htm ; v3.02.80 `tr.exe' and `cat.exe' included in GNU text utilities LEO/gnu/systools/gnututil.zip ; v1.19 HOBBES/util/file/gnututil.zip ; v1.19 JSAWA/gnu/text-util.htm ; v1.22f or later `sh.exe' included in KSH package LEO/shells/pdksh-5.2.13-emx.zip HOBBES/util/shell/ksh527rt.zip `chmod.exe' included in GNU file utilities LEO/gnu/systools/gnufutil.zip ; v3.13 HOBBES/util/file/gnufutil.zip ; v3.13 JSAWA/gnu/fileutils.htm ; v3.16 /*----- end of document -----------------------------------------------------*/