winbash-checkins Mailing List for winbash - bash for win32 (Page 3)
Brought to you by:
enricobrunetta,
xks
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
(119) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
Update of /cvsroot/winbash/winbash/documentation In directory usw-pr-cvs1:/tmp/cvs-serv6262/documentation Modified Files: Makefile README bash.1 bash.ps bash.txt builtins.txt features.dvi features.ps readline.ps readline.txt Log Message: Major realignment to 1.14.7 Index: Makefile =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 9 Mar 2002 16:05:42 -0000 1.3 +++ Makefile 11 Mar 2002 14:32:14 -0000 1.4 @@ -1,18 +1,18 @@ # This Makefile is for the Bash/documentation directory -*- text -*-. # -CP = cp RM = rm -f -INSTALL_DATA = install -c -m 644 +INSTALL_DATA = ../support/install.sh -c -m 644 -DOC_SUPPORT = ../lib/doc-support/ -TEXINDEX = $(DOC_SUPPORT)texindex -TEXINDSRC = $(DOC_SUPPORT)texindex.c +# unused +TEXINDEX = texindex TEX = tex + +MAKEINFO = makeinfo +TEXI2DVI = ../support/texi2dvi QUIETPS = #set this to -q to shut up dvips DVIPS = dvips -D 300 $(QUIETPS) -o $@ # tricky TEXINPUTS = ./../lib/readline/doc -MAKEINFO = makeinfo # Change to groff -Tascii if you don't have nroff NROFF = nroff @@ -51,15 +51,13 @@ all: ps info dvi text -ps: bash.ps builtins.ps readline.ps article.ps +ps: bash.ps readline.ps article.ps dvi: features.dvi features.ps info: features.info text: bash.txt builtins.txt readline.txt article.txt features.dvi: features.texi $(HSUSER) $(RLUSER) - TEXINPUTS=.:$(TEXINPUTS):$$TEXINPUTS $(TEX) features.texi - $(TEXINDEX) features.?? - TEXINPUTS=.:$(TEXINPUTS):$$TEXINPUTS $(TEX) features.texi + TEXINPUTS=.:$(TEXINPUTS):$$TEXINPUTS $(TEXI2DVI) features.texi features.ps: features.dvi $(RM) $@ @@ -68,26 +66,13 @@ features.info: features.texi $(HSUSER) $(RLUSER) $(MAKEINFO) --no-split -I$(TEXINPUTS) features.texi -bash.dvi: $(TEXINDEX) bash.texinfo $(HSUSER) $(RLUSER) - TEXINPUTS=.:$(TEXINPUTS):$$TEXINPUTS $(TEX) bash.texinfo - $(TEXINDEX) bash.?? - TEXINPUTS=.:$(TEXINPUTS):$$TEXINPUTS $(TEX) bash.texinfo - -bashman.ps: bash.dvi - rm -f $@ - $(DVIPS) bash.dvi - bash.txt: bash.1 bash.ps: bash.1 -builtins.ps: builtins.1 bash.1 builtins.txt: builtins.1 bash.1 readline.txt: readline.3 readline.ps: readline.3 article.ps: article.ms -$(TEXINDEX): $(TEXINDSRC) - (cd $(DOC_SUPPORT); $(MAKE) $(MFLAGS) texindex) - hsuser.texinfo: ../lib/readline/doc/hsuser.texinfo ln -s ../lib/readline/doc/hsuser.texinfo . @@ -95,25 +80,24 @@ ln -s ../lib/readline/doc/rluser.texinfo . clean: - rm -f *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \ - *.fns *.kys *.tps *.vrs *.o core texindex rluser.texinfo hsuser.texinfo + $(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \ + *.fns *.kys *.tps *.vrs *.o core rluser.texinfo hsuser.texinfo -distclean: - rm -f *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \ - *.dvi *.info *.info-* *.fns *.kys *.tps *.vrs *.o core texindex \ - rluser.texinfo hsuser.texinfo +distclean mostlyclean: clean -realclean: clean +realclean maintainer-clean: clean + rm -f *.dvi *.info *.ps *.txt -install: all +installdirs: -[ -d $(mandir) ] || mkdir $(mandir) - $(INSTALL_DATA) bash.1 $(mandir) - sed 's:so bash.1:so man1/bash.1:' < builtins.1 > $(mandir)/bash_builtins.1 -[ -d $(man3dir) ] || mkdir $(man3dir) - $(INSTALL_DATA) readline.3 $(man3dir) -[ -d $(infodir) ] || mkdir $(infodir) + +install: all installdirs + $(INSTALL_DATA) bash.1 $(mandir) + $(INSTALL_DATA) readline.3 $(man3dir) $(INSTALL_DATA) features.info $(infodir)/bash.info uninstall: - $(RM) $(mandir)/bash.1 $(mandir)/bash_builtins.1 + $(RM) $(mandir)/bash.1 $(RM) $(man3dir)/readline.3 $(infodir)/bash.info Index: README =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- README 9 Mar 2002 04:43:15 -0000 1.2 +++ README 11 Mar 2002 14:32:14 -0000 1.3 @@ -1,5 +1,6 @@ This directory contains the bash documentation. +FAQ - a set of frequently-asked questions about Bash with answers article.ms - an article I wrote about bash for The Linux Journal bash.1 - the bash man page builtins.1 - a man page that documents the builtins, extracted from bash.1 Index: bash.1 =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/bash.1,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- bash.1 11 Mar 2002 04:50:29 -0000 1.5 +++ bash.1 11 Mar 2002 14:32:14 -0000 1.6 @@ -10,7 +10,7 @@ .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ -! .TH BASH 1 "1995 May 5" GNU +.TH BASH 1 "1995 May 5" GNU .\" .\" There's some problem with having a `@' .\" in a tagged paragraph with the BSD man macros. @@ -837,12 +837,7 @@ below). The default path is system\-dependent, and is set by the administrator who installs .BR bash . -A common value is -``.:/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:/etc:/usr/etc''. -Note that in some circumstances, however, a leading `.' in -.SM -.B PATH -can be a security hazard. +A common value is ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''. .TP .B HOME The home directory of the current user; the default argument for the Index: bash.ps =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/bash.ps,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- bash.ps 9 Mar 2002 04:43:15 -0000 1.2 +++ bash.ps 11 Mar 2002 14:32:14 -0000 1.3 @@ -290,7 +290,8 @@ (cutes commands from this \214le, then e).15 F(xits.)-.15 E F2(Bash')5.224 E(s) -.37 E F0 -.15(ex)2.724 G .224(it status is the e).15 F .224 (xit status of the last com-)-.15 F(mand e)108 691.2 Q -.15(xe)-.15 G -(cuted in the script.).15 E 186.51(GNU 1995)72 768 R(Mar 9)2.5 E(1)535 768 Q EP +(cuted in the script.).15 E 185.675(GNU 1995)72 768 R(May 5)2.5 E(1)535 768 Q +EP %%Page: 2 2 %%BeginPageSetup BP @@ -376,8 +377,8 @@ 650.4 Q F3(command)144 667.2 Q F2(&&)2.5 E F3(command2)2.5 E(command2)108 684 Q [...3859 lines suppressed...] +(ug reports should include:)-.2 E(The v)108 141.6 Q(ersion number of)-.15 E F2 +(bash)2.5 E F0(The hardw)108 153.6 Q(are and operating system)-.1 E +(The compiler used to compile)108 165.6 Q 2.5(Ad)108 177.6 S +(escription of the b)122.72 177.6 Q(ug beha)-.2 E(viour)-.2 E 2.5(As)108 189.6 +S(hort script or `recipe' which e)121.61 189.6 Q -.15(xe)-.15 G(rcises the b) +.15 E(ug)-.2 E F1(bashb)108 206.4 Q(ug)-.2 E F0 +(inserts the \214rst three items automatically into the template it pro)2.5 E +(vides for \214ling a b)-.15 E(ug report.)-.2 E(Comments and b)108 223.2 Q +(ug reports concerning this manual page should be directed to)-.2 E F1 -.15(ch) +2.5 G(et@ins.CWR).15 E -.25(U.)-.4 G(Edu).25 E F0(.).25 E/F3 9/Times-Bold@0 SF +-.09(BU)72 240 S(GS).09 E F0(It')108 252 Q 2.5(st)-.55 G(oo big and too slo) +126.06 252 Q -.65(w.)-.25 G 1.868(There are some subtle dif)108 268.8 R 1.868 +(ferences between)-.25 F F2(bash)4.369 E F0 1.869(and traditional v)4.369 F +1.869(ersions of)-.15 F F2(sh)4.369 E F0 4.369(,m)C 1.869(ostly because of the) +455.243 268.8 R F3(POSIX)108 280.8 Q F0(speci\214cation.)2.25 E +(Aliases are confusing in some uses.)108 297.6 Q 185.675(GNU 1995)72 768 R +(May 5)2.5 E(37)530 768 Q EP %%Trailer end %%EOF Index: bash.txt =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/bash.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- bash.txt 9 Mar 2002 04:43:15 -0000 1.2 +++ bash.txt 11 Mar 2002 14:32:15 -0000 1.3 @@ -60,7 +60,7 @@ -GNU Last change: 1994 July 26 1 +GNU Last change: 1995 May 5 1 @@ -126,7 +126,7 @@ [...2095 lines suppressed...] be directed to _c_h_e_t@_i_n_s._C_W_R_U._E_d_u. @@ -3954,7 +3944,17 @@ -GNU Last change: 1994 July 26 60 + + + + + + + + + + +GNU Last change: 1995 May 5 60 Index: builtins.txt =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/builtins.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- builtins.txt 9 Mar 2002 04:43:15 -0000 1.2 +++ builtins.txt 11 Mar 2002 14:32:15 -0000 1.3 @@ -838,17 +838,17 @@ shift [_n] The positional parameters from _n+1 ... are renamed to - $1 .... If _n is not given, it is assumed to be 1. The - exit status is 1 if _n is greater than $#; otherwise 0. + $1 .... Parameters represented by the numbers $# down + to $#-_n+1 are unset. If _n is 0, no parameters are + changed. If _n is not given, it is assumed to be 1. _n + must be a non-negative number less than or equal to $#. + If _n is greater than $#, the positional parameters are + not changed. The return status is greater than 0 if _n + is greater than $# or less than 0; otherwise 0. suspend [-f] Suspend the execution of this shell until it receives a SIGCONT signal. The -f option says not to complain if - this is a login shell; just suspend anyway. The return - status is 0 unless the shell is a login shell and -f is - not supplied, or if job control is not enabled. - - test _e_x_p_r @@ -863,6 +863,11 @@ + this is a login shell; just suspend anyway. The return + status is 0 unless the shell is a login shell and -f is + not supplied, or if job control is not enabled. + + test _e_x_p_r [ _e_x_p_r ] Return a status of 0 (true) or 1 (false) depending on the evaluation of the conditional expression _e_x_p_r. @@ -910,11 +915,6 @@ True if _f_i_l_e exists and is owned by the effective user id. -G _f_i_l_e - True if _f_i_l_e exists and is owned by the effective - group id. - _f_i_l_e_1 -nt _f_i_l_e_2 - True if _f_i_l_e_1 is newer (according to modification - date) than _f_i_l_e_2. @@ -929,6 +929,11 @@ + True if _f_i_l_e exists and is owned by the effective + group id. + _f_i_l_e_1 -nt _f_i_l_e_2 + True if _f_i_l_e_1 is newer (according to modification + date) than _f_i_l_e_2. _f_i_l_e_1 -ot _f_i_l_e_2 True if _f_i_l_e_1 is older than file2. _f_i_l_e_1 -ef _f_i_l_e @@ -976,11 +981,6 @@ _a_r_g is executed on exit from the shell. With no argu- ments, trap prints the list of commands associated with each signal number. The -l option causes the shell to - print a list of signal names and their corresponding - numbers. An argument of -- disables option checking - for the rest of the arguments. Signals ignored upon - entry to the shell cannot be trapped or reset. Trapped - signals are reset to their original values in a child @@ -995,6 +995,11 @@ + print a list of signal names and their corresponding + numbers. An argument of -- disables option checking + for the rest of the arguments. Signals ignored upon + entry to the shell cannot be trapped or reset. Trapped + signals are reset to their original values in a child process when it is created. The return status is false if either the trap name or number is invalid; otherwise trap returns true. @@ -1042,11 +1047,6 @@ -a all current limits are reported -c the maximum size of core files created -d the maximum size of a process's data segment - -f the maximum size of files created by the shell - -m the maximum resident set size - -s the maximum stack size - -t the maximum amount of cpu time in seconds - -p the pipe size in 512-byte blocks (this may not be @@ -1061,6 +1061,11 @@ + -f the maximum size of files created by the shell + -m the maximum resident set size + -s the maximum stack size + -t the maximum amount of cpu time in seconds + -p the pipe size in 512-byte blocks (this may not be set) -n the maximum number of open file descriptors (most systems do not allow this value to be set, only @@ -1108,11 +1113,6 @@ Note that PATH, IFS, PPID, PS1, PS2, UID, and EUID can- not be unset. If any of RANDOM, SECONDS, LINENO, or HISTCMD are unset, they lose their special properties, - even if they are subsequently reset. The exit status - is true unless a _n_a_m_e does not exist or is non- - unsettable. - - wait [_n] @@ -1127,6 +1127,11 @@ + even if they are subsequently reset. The exit status + is true unless a _n_a_m_e does not exist or is non- + unsettable. + + wait [_n] Wait for the specified process and return its termina- tion status. _n may be a process ID or a job specifica- tion; if a job spec is given, all processes in that @@ -1139,11 +1144,6 @@ SEE ALSO bash(1), sh(1) - - - - - Index: features.dvi =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/features.dvi,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsP9EmAa and /tmp/cvsEIJ9Pc differ Index: features.ps =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/features.ps,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- features.ps 9 Mar 2002 04:43:15 -0000 1.2 +++ features.ps 11 Mar 2002 14:32:15 -0000 1.3 @@ -1,4279 +1,3825 @@ -%!PS-Adobe-2.0 -%%Creator: dvipsk 5.490s Copyright 1986, 1992 Radical Eye Software -%%Title: features.dvi -%%Pages: 60 1 -%%BoundingBox: 0 0 612 792 -%%EndComments +%!PS (but not EPSF; comments have been disabled) %DVIPSCommandLine: dvips -D 300 -o features.ps features.dvi -%%BeginProcSet: tex.pro -%! -/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N} [...8025 lines suppressed...] +b(Readline)j(T)o(yp)q(e)d(F)l(or)g(Y)l(ou)5 b Fa(:)i(:)h(:)f(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)20 b Fl(48)299 1692 y(7.4.7)44 b(Keyb)q(oard)15 +b(Macros)9 b Fa(:)e(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)h(:)f(:)24 b Fl(48)299 1754 y(7.4.8)44 +b(Some)15 b(Miscellaneous)i(Commands)11 b Fa(:)d(:)f(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)27 b Fl(49)149 1816 y(7.5)45 b(Readline)17 b(vi)f(Mo)q(de)d +Fa(:)7 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)27 +b Fl(50)0 1941 y Fj(App)r(endix)d(A)67 b(V)-6 b(ariable)24 +b(Index)15 b Fb(:)c(:)f(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)38 b Fj(51)0 +2081 y(App)r(endix)24 b(B)67 b(Concept)22 b(Index)c Fb(:)10 +b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)39 b Fj(53)p eop end userdict /end-hook known{end-hook}if -%%EOF Index: readline.ps =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/readline.ps,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- readline.ps 9 Mar 2002 04:43:15 -0000 1.2 +++ readline.ps 11 Mar 2002 14:32:15 -0000 1.3 @@ -217,19 +217,19 @@ (o, k)-.18 E(eymap\))-.1 E(char *k)108 427.2 Q(eyseq, *macr)-.1 E(o;)-.18 E -.25(Ke)108 439.2 S(ymap k).25 E(eymap;)-.1 E(int rl_v)108 456 Q (ariable_bind \(v)-.1 E(ariable, v)-.1 E(alue\))-.1 E(char *v)108 468 Q -(ariable, *v)-.1 E(alue;)-.1 E(int rl_parse_and_bind \(line\))108 489.6 Q -(char *line;)108 501.6 Q(int rl_translate_k)108 518.4 Q(eyseq \(k)-.1 E -(eyseq, array)-.1 E 2.5(,l)-.55 G(en\))276.68 518.4 Q(char *k)108 530.4 Q -(eyseq, *array;)-.1 E(int *len;)108 542.4 Q -(Function *rl_named_function \(command\))108 559.2 Q(char *command;)108 571.2 Q -(Function *rl_function_of_k)108 588 Q(eyseq \(k)-.1 E(eyseq, k)-.1 E -(eymap, type\))-.1 E(char *k)108 600 Q(eyseq;)-.1 E -.25(Ke)108 612 S(ymap k) -.25 E(eymap;)-.1 E(int *type;)108 624 Q(char **rl_in)108 640.8 Q -.1(vo)-.4 G -(king_k).1 E(eyseqs \(function\))-.1 E(Function *function;)108 652.8 Q -(char **rl_in)108 669.6 Q -.1(vo)-.4 G(king_k).1 E(eyseqs_in_map \(function, k) --.1 E(eymap\))-.1 E(Function *function;)108 681.6 Q -.25(Ke)108 693.6 S(ymap k) -.25 E(eymap;)-.1 E -.1(vo)108 710.4 S(id rl_function_dumper \(r).1 E(eadable\)) --.18 E(int r)108 722.4 Q(eadable;)-.18 E F0 184.005(GNU 1994)72 768 R(July 26) +(ariable, *v)-.1 E(alue;)-.1 E(int rl_parse_and_bind \(line\))108 484.8 Q +(char *line;)108 496.8 Q(int rl_translate_k)108 513.6 Q(eyseq \(k)-.1 E +(eyseq, array)-.1 E 2.5(,l)-.55 G(en\))276.68 513.6 Q(char *k)108 525.6 Q +(eyseq, *array;)-.1 E(int *len;)108 537.6 Q +(Function *rl_named_function \(command\))108 554.4 Q(char *command;)108 566.4 Q +(Function *rl_function_of_k)108 583.2 Q(eyseq \(k)-.1 E(eyseq, k)-.1 E +(eymap, type\))-.1 E(char *k)108 595.2 Q(eyseq;)-.1 E -.25(Ke)108 607.2 S +(ymap k).25 E(eymap;)-.1 E(int *type;)108 619.2 Q(char **rl_in)108 636 Q -.1 +(vo)-.4 G(king_k).1 E(eyseqs \(function\))-.1 E(Function *function;)108 648 Q +(char **rl_in)108 664.8 Q -.1(vo)-.4 G(king_k).1 E(eyseqs_in_map \(function, k) +-.1 E(eymap\))-.1 E(Function *function;)108 676.8 Q -.25(Ke)108 688.8 S(ymap k) +.25 E(eymap;)-.1 E -.1(vo)108 705.6 S(id rl_function_dumper \(r).1 E(eadable\)) +-.18 E(int r)108 717.6 Q(eadable;)-.18 E F0 184.005(GNU 1994)72 768 R(July 26) 2.5 E(1)535 768 Q EP %%Page: 2 2 %%BeginPageSetup @@ -690,9 +690,9 @@ -1.667(M\255_ \))2.5 F F0 1.077(Insert the last ar)144 628.8 R 1.077 (gument to the pre)-.18 F 1.077(vious command \(the last w)-.25 F 1.077 (ord on the pre)-.1 F 1.077(vious line\).)-.25 F -.4(Wi)6.076 G 1.076(th an).4 -F(ar)144 640.8 Q(gument, beha)-.18 E .3 -.15(ve ex)-.2 H(actly lik).15 E 2.5 -(e@)-.1 G(code{yank-nth-ar)274.9 640.8 Q(g}.)-.18 E F1(Commands f)87 657.6 Q -(or Changing T)-.25 E(ext)-.92 E(delete\255char \(C\255d\))108 669.6 Q F0 .486 +F(ar)144 640.8 Q(gument, beha)-.18 E .3 -.15(ve ex)-.2 H(actly lik).15 E(e)-.1 +E F1(yank-nth-ar)2.5 E(g)-.1 E F0(.)A F1(Commands f)87 657.6 Q(or Changing T) +-.25 E(ext)-.92 E(delete\255char \(C\255d\))108 669.6 Q F0 .486 (Delete the character under the cursor)144 681.6 R 5.486(.I)-.55 G 2.987(fp) 304.636 681.6 S .487(oint is at the be)315.953 681.6 R .487 (ginning of the line, there are no charac-)-.15 F Index: readline.txt =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/readline.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- readline.txt 9 Mar 2002 04:43:15 -0000 1.2 +++ readline.txt 11 Mar 2002 14:32:15 -0000 1.3 @@ -601,7 +601,7 @@ Insert the last argument to the previous command (the last word on the previous line). With an argument, - behave exactly like @code{yank-nth-arg}. + behave exactly like yank-nth-arg. Commands for Changing Text delete-char (C-d) |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:21
|
Update of /cvsroot/winbash/winbash/tests In directory usw-pr-cvs1:/tmp/cvs-serv6262/tests Removed Files: x xx Log Message: Major realignment to 1.14.7 --- x DELETED --- --- xx DELETED --- |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:21
|
Update of /cvsroot/winbash/winbash/tests/misc In directory usw-pr-cvs1:/tmp/cvs-serv6262/tests/misc Added Files: chld-trap.sh dot-test-1.sh dot-test-1.sub gotest perf-script redir.t1.sh redir.t2.sh redir.t3.sh redir.t3.sub redir.t4.sh run.r1.sh run.r2.sh run.r3.sh sigint.t1.sh sigint.t2.sh sigint.t3.sh sigint.t4.sh test-minus-e.1 test-minus-e.2 Log Message: Major realignment to 1.14.7 --- NEW FILE: chld-trap.sh --- #! /bin/sh # # show that setting a trap on SIGCHLD is not disastrous. # trap 'echo caught a child death' SIGCHLD sleep 5 & sleep 5 & sleep 5 & wait exit 0 --- NEW FILE: dot-test-1.sh --- echo this is $0 . ./dot-test-1.sub echo after . dot-test-1.sub --- NEW FILE: dot-test-1.sub --- echo this is dot-test-1.sub --- NEW FILE: gotest --- aflag= bflag= while getopts ab: name do case $name in a) aflag=1 ;; b) bflag=1 bval=$OPTARG;; ?) echo Usage: $0 [-a] [-b value] args exit 2;; esac done if [ ! -z "$aflag" ] ; then echo -a specified ; fi if [ ! -z "$bflag" ] ; then echo -b $bval specified ; fi if [ "$OPTIND" -gt 1 ] then shift $(( $OPTIND - 1 )) fi echo remaining args: "$*" exit 0 --- NEW FILE: perf-script --- #!/bin/bash typeset -i m2 m1 M n2 n1 N m n typeset -i MM=5 NN=5 case $# in 0) : ;; 1) MM=$1; NN=$1 ;; 2) MM=$1; NN=$2 ;; *) echo 1>&2 "Usage: $0 [m [n]]" ;; esac EMPTYLINE=: # echo echo 'a = { ' # mathematica let "M=1" # for (M=1; M<=MM; M++) while let "M <= MM"; do let "N=1" # for (N=1; N<=NN; N++) while let "N <= NN"; do let "m1 = M - 1" let "m2 = M + 1" let "n1 = N - 1" let "n2 = N + 1" echo -n '{ ' # math let "m=1" # for(m=1; m<=MM; m++) while let "m <= MM"; do let "n=1" # for(n=1; n<=NN; n++) while let "n <= NN"; do let "x = (m-m1)*(m-M)*(m-m2)" let "y = (n-n1)*(n-N)*(n-n2)" if let "(x*x + (n-N)*(n-N)) * ((m-M)*(m-M) + y*y)"; then echo -n "0," else # neighbour echo -n "1," fi let "n=n+1" done echo -n " "; let "m=m+1" # ". " done echo '},' let "N=N+1" $EMPTYLINE done $EMPTYLINE let "M=M+1" done echo '}' echo -n 'o = { ' let "m=1" while let "m <= MM"; do let "n=1" while let "n <= NN"; do echo -n "1," let "n=n+1" done let "m=m+1" done echo " }" echo 'x = LinearSolve[a,o] ' exit 0 --- NEW FILE: redir.t1.sh --- read line1 echo read line1 \"$line1\" exec 4</etc/passwd exec 5<&0 exec 0<&4 read line2 echo read line2 \"$line2\" exec 0<&5 read line3 echo read line3 \"$line3\" exec 0<&4 read line4 echo read line4 \"$line4\" exec 4<&- --- NEW FILE: redir.t2.sh --- read line1 echo read line 1 \"$line1\" exec 4<&0 exec 0</dev/tty read line2 echo line read from tty = \"$line2\" exec 0<&4 read line3 echo read line 3 \"$line3\" --- NEW FILE: redir.t3.sh --- # # Test the effect of input buffering on the shell's input # echo this is redir.t3.sh exec 0< redir.t3.sub echo after exec in redir.t3.sh --- NEW FILE: redir.t3.sub --- echo this is redir-test-3.sub --- NEW FILE: redir.t4.sh --- echo "Point 1" exec 3</etc/passwd exec 4>a exec 5>b echo "Point 2" echo to a 1>&4 echo to b 1>&5 exec 11</etc/printcap echo "Point 3" echo to a 1>&4 echo to b 1>&5 exit 0 --- NEW FILE: run.r1.sh --- ../../bash redir.t1.sh --- NEW FILE: run.r2.sh --- ../../bash ./redir.t2.sh < /etc/passwd --- NEW FILE: run.r3.sh --- # # the `after exec in ...' should not be echoed ../../bash < redir.t3.sh --- NEW FILE: sigint.t1.sh --- echo before trap trap 'echo caught sigint' 2 echo after trap for i in 1 2 3 do echo $i sleep 5 done --- NEW FILE: sigint.t2.sh --- echo before loop for i in 1 2 3 do echo $i sleep 5 done --- NEW FILE: sigint.t3.sh --- sleep 5 & sleep 5 & sleep 5 & echo wait 1 wait echo wait 2 wait exit --- NEW FILE: sigint.t4.sh --- trap 'echo sigint' 2 sleep 5 & sleep 5 & sleep 5 & echo wait 1 wait echo wait 2 wait exit --- NEW FILE: test-minus-e.1 --- touch .file while set -e ; test -r .file ; do echo -n "stop loop? " read reply case "$reply" in y*) rm .file non-dash-file ;; esac set +e done --- NEW FILE: test-minus-e.2 --- touch .file set -e while set +e ; test -r .file ; do echo -n "stop loop? [yes to quit] " read reply if [ "$reply" = yes ] ; then rm .file non-dash-file fi set -e done rm -f .file |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:20
|
Update of /cvsroot/winbash/winbash/support In directory usw-pr-cvs1:/tmp/cvs-serv6262/support Modified Files: bashbug.sh Added Files: texi2dvi Removed Files: FAQ Log Message: Major realignment to 1.14.7 --- NEW FILE: texi2dvi --- #!/bin/sh # texi2dvi -- smartly produce DVI files from texinfo sources # # Copyright (C) 1992, 1993 Free Software Foundation. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, you can either send email to this # program's author (see below) or write to: # # Free Software Foundation, Inc. # 675 Mass Ave. # Cambridge, MA 02139, USA. # # Please send bug reports, etc. to bug...@pr... # If possible, please send a copy of the output of the script called with # the `--debug' option when making a bug report. # # Version 0.4 # Last modified 26-Mar-93 # # Please note that in the interest of general portability, some common # bourne shell constructs were avoided because they weren't guaranteed to # be available in some earlier implementations. I've tried to make this as # portable as possible. # # Among the more interesting lossages I noticed with some bourne shells # are: # 1) Some don't have an `unset' builtin # 2) In some implementations the `shift' builtin can't take a # numerical argument. progname=`basename $0` usage="Usage: ${progname} {-D} {-h} [file1] {file2} {...} {--debug} {--help} Options in braces are optional. Those in brackets are required. " if test $# -eq 0 ; then echo "${usage}" 1>&2; exit 1 fi backup_extension=".bak" texindex="texindex" tex="tex" bq="\`" # To prevent hairy quoting and escaping later. eq="'" orig_pwd="`pwd`" if test "z${TEXINDEX}" != "z" ; then texindex="${TEXINDEX}" fi if test "z${TEX}" != "z" ; then tex="${TEX}" fi # Save this so we can construct a new TEXINPUTS path for each file to be # processed. TEXINPUTS_orig="${TEXINPUTS}" export TEXINPUTS # Parse command line options # "unset" option variables to make sure they weren't accidentally # exported debug="" # If you add new commands be sure to change the wildcards below to make # sure they are unambiguous (i.e. only match one possible long option) # Be sure to show at least one instance of the full long option name to # document what the long option is canonically called. while test $# -gt 0 ; do case z$1 in z-D | z--debug | z--d* ) debug="t" shift ;; z-h | z--help | z--h* ) echo "${usage}" 1>&2 exit 1 ;; z-- ) shift break ;; z-* ) echo "${progname}: ${bq}${1}${eq} is not a valid option." 1>&2 echo "" 1>&2 echo "${usage}" 1>&2 exit 1 ;; * ) break ;; esac done # See if there are any command line args left (which will be interpreted as # filename arguments) if test $# -eq 0 ; then echo "${progname}: at least one file name is required as an argument." 1>&2 echo "" 1>&2 echo "${usage}" 1>&2 exit 1 fi test "z${debug}" = "zt" && set -x # Texify files for command_line_filename in ${1+"$@"} ; do # Roughly equivalent to `dirname ...`, but more portable directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`" filename_texi="`basename ${command_line_filename}`" # Strip off the last extension part (probably .texinfo or .texi) filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`" # If directory and file are the same, then it's probably because there's # no pathname component. Set dirname to `.', the current directory. if test "z${directory}" = "z${command_line_filename}" ; then directory="." fi # Source file might @include additional texinfo sources. Put `.' and # directory where source file(s) reside in TEXINPUTS before anything # else. `.' goes first to ensure that any old .aux, .cps, etc. files in # ${directory} don't get used in preference to fresher files in `.'. TEXINPUTS=".:${directory}:${TEXINPUTS_orig}" # "Unset" variables that might have values from previous iterations and # which won't be completely reset later. definite_index_files="" # See if file exists here. If it doesn't we're in trouble since, even # though the user may be able to reenter a valid filename at the tex # prompt (assuming they're attending the terminal), this script won't be # able to find the right index files and so forth. if test ! -r "${command_line_filename}" ; then echo "${progname}: ${command_line_filename}: No such file or permission denied." 1>&2 continue; fi # Find all files having root filename with a two-letter extension, # determine whether they're really index files, and save them. Foo.aux # is actually the cross-references file, but we need to keep track of # that too. possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" for this_file in ${possible_index_files} ; do # If file is empty, forget it. if test ! -s "${this_file}" ; then continue; fi # Examine first character of file. If it's not a backslash or # single quote, then it's definitely not an index or xref file. first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then definite_index_files="${definite_index_files} ${this_file}" fi done orig_index_files="${definite_index_files}" orig_index_files_sans_aux="`echo ${definite_index_files} \ | sed 's/'${filename_noext}'\.aux//; s/^[ ]*//;s/[ ]*$//;'`" # Now save copies of original index files so we have some means of # comparison later. for index_file_to_save in ${orig_index_files} ; do cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}" done # Run texindex on current index files. If they already exist, and # after running TeX a first time the index files don't change, then # there's no reason to run TeX again. But we won't know that if the # index files are out of date or nonexistent. if test "${orig_index_files_sans_aux}" ; then ${texindex} ${orig_index_files_sans_aux} fi if ${tex} ${command_line_filename} ; then # TeX run first time definite_index_files="" # Get list of new index files possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`" for this_file in ${possible_index_files} ; do # If file is empty, forget it. if test ! -s ${this_file} ; then continue; fi # Examine first character of file. If it's not a backslash or # single quote, then it's definitely not an index or xref file. first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`" if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then definite_index_files="${definite_index_files} ${this_file}" fi done new_index_files="${definite_index_files}" new_index_files_sans_aux="`echo ${definite_index_files} \ | sed 's/'${filename_noext}'\.aux//; s/^[ ]*//;s/[ ]*$//;'`" # If old and new list don't at least have the same file list, then one # file or another has definitely changed. if test "${orig_index_files}" != "${new_index_files}" ; then index_files_changed_p=t else # File list is the same. We must compare each file until we find a # difference. index_files_changed_p="" for this_file in ${new_index_files} ; do # cmp -s will return nonzero exit status if files differ. cmp -s "${this_file}" "${this_file}${backup_extension}" if test $? -ne 0 ; then # We only need to keep comparing until we find *one* that # differs, because we'll have to run texindex & tex no # matter what. index_files_changed_p=t break fi done fi # If index files have changed since TeX has been run, or if the aux # file wasn't present originally, run texindex and TeX again. if test "${index_files_changed_p}" ; then retval=0 if test "${new_index_files_sans_aux}" ; then ${texindex} ${new_index_files_sans_aux} retval=$? fi if test ${retval} -eq 0 ; then ${tex} "${command_line_filename}" fi fi fi # Generate list of files to delete, then call rm once with the entire # list. This is significantly faster than multiple executions of rm. file_list="" for file in ${orig_index_files} ; do file_list="${file_list} ${file}${backup_extension}" done if test "${file_list}" ; then rm -f ${file_list} fi done # # eof # Index: bashbug.sh =================================================================== RCS file: /cvsroot/winbash/winbash/support/bashbug.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- bashbug.sh 11 Mar 2002 01:47:05 -0000 1.4 +++ bashbug.sh 11 Mar 2002 14:32:16 -0000 1.5 @@ -30,9 +30,9 @@ fi if [ -f /usr/lib/sendmail ] ; then - RMAIL="/usr/lib/sendmail -t" + RMAIL="/usr/lib/sendmail" elif [ -f /usr/sbin/sendmail ] ; then - RMAIL="/usr/sbin/sendmail -t" + RMAIL="/usr/sbin/sendmail" else RMAIL=rmail fi --- FAQ DELETED --- |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:20
|
Update of /cvsroot/winbash/winbash/lib/readline In directory usw-pr-cvs1:/tmp/cvs-serv6262/lib/readline Modified Files: Makefile complete.c display.c emacs_keymap.c readline.c vi_mode.c Log Message: Major realignment to 1.14.7 Index: Makefile =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Makefile 9 Mar 2002 03:39:13 -0000 1.1.1.1 +++ Makefile 11 Mar 2002 14:32:16 -0000 1.2 @@ -98,10 +98,6 @@ cd $(incdir)/readline && ${RM} -f ${INSTALLED_HEADERS} cd $(libdir) && ${RM} -f libreadline.a libreadline.old -clean: - rm -f $(OBJECTS) *.a - (if [ -d doc ]; then cd doc; $(MAKE) $(MFLAGS) $@; fi) - tags: force etags $(CSOURCES) $(HSOURCES) @@ -114,7 +110,12 @@ $(LOCAL_INCLUDES) -DTEST -o readline readline.c vi_mode.o funmap.o \ keymaps.o -ltermcap -realclean distclean mostlyclean: clean +clean: + $(RM) -f $(OBJECTS) libreadline.a libhistory.a + (if [ -d doc ]; then cd doc; $(MAKE) $(MFLAGS) $@; fi) + +maintainer-clean realclean distclean mostlyclean: clean + (if [ -d doc ]; then cd doc; $(MAKE) $(MFLAGS) $@; fi) # Dependencies readline.o: readline.c readline.h rldefs.h rlconf.h chardefs.h Index: complete.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/complete.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- complete.c 11 Mar 2002 04:50:29 -0000 1.4 +++ complete.c 11 Mar 2002 14:32:16 -0000 1.5 @@ -596,12 +596,12 @@ /* Sort the items. */ /* It is safe to sort this array, because the lowest common denominator found in matches[0] will remain in place. */ - for (i = 0; matches[i]; i++) - ; - /* Try sorting the array without matches[0], since we need it to - stay in place no matter what. */ - if (i) - qsort (matches+1, i-1, sizeof (char *), compare_strings); + for (i = 0; matches[i]; i++) + ; + /* Try sorting the array without matches[0], since we need it to + stay in place no matter what. */ + if (i) + qsort (matches+1, i-1, sizeof (char *), compare_strings); /* Remember the lowest common denominator for it may be unique. */ lowest_common = savestring (matches[0]); Index: display.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/display.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- display.c 11 Mar 2002 01:47:05 -0000 1.3 +++ display.c 11 Mar 2002 14:32:16 -0000 1.4 @@ -698,7 +698,7 @@ putc (' ', rl_outstream); _rl_last_c_pos = 1; /* XXX */ _rl_last_v_pos++; - if (old[0]) + if (old[0] && new[0]) old[0] = new[0]; } Index: emacs_keymap.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/emacs_keymap.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- emacs_keymap.c 9 Mar 2002 03:39:13 -0000 1.1.1.1 +++ emacs_keymap.c 11 Mar 2002 14:32:16 -0000 1.2 @@ -430,7 +430,7 @@ { ISFUNC, rl_do_lowercase_version }, /* Meta-Z */ /* Some more punctuation. */ - { ISFUNC, rl_arrow_keys }, /* Meta-[ */ /* was rl_arrow_keys */ + { ISFUNC, (Function *)0x0 }, /* Meta-[ */ /* was rl_arrow_keys */ { ISFUNC, rl_delete_horizontal_space }, /* Meta-\ */ { ISFUNC, (Function *)0x0 }, /* Meta-] */ { ISFUNC, (Function *)0x0 }, /* Meta-^ */ @@ -452,7 +452,7 @@ { ISFUNC, rl_downcase_word }, /* Meta-l */ { ISFUNC, (Function *)0x0 }, /* Meta-m */ { ISFUNC, rl_noninc_forward_search }, /* Meta-n */ - { ISFUNC, rl_arrow_keys }, /* Meta-o */ /* was rl_arrow_keys */ + { ISFUNC, (Function *)0x0 }, /* Meta-o */ /* was rl_arrow_keys */ { ISFUNC, rl_noninc_reverse_search }, /* Meta-p */ { ISFUNC, (Function *)0x0 }, /* Meta-q */ { ISFUNC, rl_revert_line }, /* Meta-r */ Index: readline.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/readline.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- readline.c 11 Mar 2002 01:47:05 -0000 1.3 +++ readline.c 11 Mar 2002 14:32:16 -0000 1.4 @@ -285,7 +285,7 @@ return ((char *)NULL); } - rl_visible_prompt_length = (rl_prompt && *rl_prompt) ? rl_expand_prompt (rl_prompt) : 0; + rl_visible_prompt_length = rl_expand_prompt (rl_prompt); rl_initialize (); rl_prep_terminal (_rl_meta_flag); @@ -629,8 +629,8 @@ { if (map[ESC].type == ISKMAP) { - if (defining_kbd_macro) - add_macro_char (ESC); + if (defining_kbd_macro) + add_macro_char (ESC); map = FUNCTION_TO_KEYMAP (map, ESC); key = UNMETA (key); rl_key_sequence_length += 2; @@ -643,7 +643,7 @@ if (defining_kbd_macro) add_macro_char (key); - + switch (map[key].type) { case ISFUNC: @@ -1001,7 +1001,7 @@ _rl_convert_meta_chars_to_ascii = 0; _rl_output_meta_chars = 1; } - + /* Read in the init file. */ rl_read_init_file ((char *)NULL); @@ -1016,16 +1016,6 @@ inputrc file. */ rl_set_keymap_from_edit_mode (); - /* Check for LC_CTYPE and use its value to decide the defaults for - 8-bit character input and output. */ - t = getenv ("LC_CTYPE"); - if (t && (strcmp (t, "iso-8859-1") == 0 || strcmp (t, "iso_8859_1") == 0)) - { - _rl_meta_flag = 1; - _rl_convert_meta_chars_to_ascii = 0; - _rl_output_meta_chars = 1; - } - /* Try to bind a common arrow key prefix, if not already bound. */ bind_arrow_keys (); @@ -1630,9 +1620,9 @@ #endif /* FALLTHROUGH */ case AUDIBLE_BELL: - PlaySound("SystemBeep", NULL, SND_ASYNC); - /*fprintf (stderr, "\007"); - fflush (stderr);*/ + PlaySound("SystemBeep", NULL, SND_ASYNC); + //fprintf (stderr, "\007"); + //fflush (stderr); break; } #else /* __GO32__ */ @@ -1756,10 +1746,10 @@ from = to; to = t; } - + if (to > rl_end) to = rl_end; - + text = rl_copy_text (from, to); /* Some versions of strncpy() can't handle overlapping arguments. */ @@ -2314,19 +2304,18 @@ { int orig_point = rl_point; if (count <= 0) - count = 1; - + count = 1; + while (count--) - { - while (rl_point && whitespace (the_line[rl_point - 1])) - rl_point--; - - while (rl_point && !whitespace (the_line[rl_point - 1])) - rl_point--; - } - + { + while (rl_point && whitespace (the_line[rl_point - 1])) + rl_point--; + + while (rl_point && !whitespace (the_line[rl_point - 1])) + rl_point--; + } + rl_kill_text (orig_point, rl_point); - } return 0; } Index: vi_mode.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/vi_mode.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vi_mode.c 11 Mar 2002 01:47:05 -0000 1.2 +++ vi_mode.c 11 Mar 2002 14:32:16 -0000 1.3 @@ -824,7 +824,7 @@ /* These are the motion commands that do not require adjusting the mark. c[wW] are handled by special-case code in rl_vi_domove(), and already leave the mark at the correct location. */ - if ((strchr (" l|hwW^0%bB", c) == 0) && (rl_mark < rl_end)) + if ((strchr (" l|hwW^0bB", c) == 0) && (rl_mark < rl_end)) rl_mark++; /* The cursor never moves with c[wW]. */ @@ -857,7 +857,7 @@ /* These are the motion commands that do not require adjusting the mark. */ - if ((strchr (" l|h^0bB", c) == 0) && (rl_mark < rl_end)) + if ((strchr (" l|h^0%bB", c) == 0) && (rl_mark < rl_end)) rl_mark++; rl_begin_undo_group (); @@ -1149,7 +1149,7 @@ rl_kill_line (1); } else - rl_delete (count, key); + rl_delete_text (rl_point, rl_point+count); rl_end_undo_group (); @@ -1232,7 +1232,7 @@ { vi_replace_map = rl_make_bare_keymap (); - for (i = ' '; i < 127; i++) + for (i = ' '; i < KEYMAP_SIZE; i++) vi_replace_map[i].function = rl_vi_overstrike; vi_replace_map[RUBOUT].function = rl_vi_overstrike_delete; |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:19
|
Update of /cvsroot/winbash/winbash/lib/tilde In directory usw-pr-cvs1:/tmp/cvs-serv6262/lib/tilde Modified Files: Makefile tilde.c Log Message: Major realignment to 1.14.7 Index: Makefile =================================================================== RCS file: /cvsroot/winbash/winbash/lib/tilde/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Makefile 9 Mar 2002 03:39:13 -0000 1.1.1.1 +++ Makefile 11 Mar 2002 14:32:16 -0000 1.2 @@ -14,7 +14,9 @@ # Please note that the values for INCLUDES, CC, AR, RM, CP, # RANLIB, and selfdir are passed in from ../Makefile, and do # not need to be defined here. -RM = rm +RM = rm -f +MV = mv +CP = cp srcdir = . VPATH = .:$(srcdir) @@ -59,7 +61,7 @@ all: $(LIBRARY_NAME) $(LIBRARY_NAME): $(OBJECTS) - $(RM) -f $@ + $(RM) $@ $(AR) cq $@ $(OBJECTS) -[ -n "$(RANLIB)" ] && $(RANLIB) $@ @@ -81,8 +83,10 @@ -[ -n "$(RANLIB)" ] && $(RANLIB) -t $(bindir)/$(LIBRARY_NAME) clean: - $(RM) -f $(OBJECTS) $(LIBRARY_NAME) - -(cd doc; $(MAKE) $(MFLAGS) clean) + $(RM) $(OBJECTS) $(LIBRARY_NAME) + -(cd doc && $(MAKE) $(MFLAGS) $@) + +maintainer-clean realclean mostlyclean distclean: clean ###################################################################### Index: tilde.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/tilde/tilde.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tilde.c 9 Mar 2002 16:05:44 -0000 1.2 +++ tilde.c 11 Mar 2002 14:32:16 -0000 1.3 @@ -251,15 +251,15 @@ else { char *username; - struct passwd *user_entry; - int i; + struct passwd *user_entry; + int i; - username = xmalloc (strlen (dirname)); - for (i = 1; dirname[i] && dirname[i] != '/'; i++) - username[i - 1] = dirname[i]; + username = xmalloc (strlen (dirname)); + for (i = 1; dirname[i] && dirname[i] != '/'; i++) + username[i - 1] = dirname[i]; username[i - 1] = '\0'; - if ((user_entry = getpwnam (username)) == 0) + if ((user_entry = getpwnam (username)) == 0) { /* If the calling program has a special syntax for expanding tildes, and we couldn't find a standard @@ -293,7 +293,7 @@ dirname = temp_name; } endpwent (); - free (username); + free (username); } } return (dirname); |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:19
|
Update of /cvsroot/winbash/winbash/lib/glob In directory usw-pr-cvs1:/tmp/cvs-serv6262/lib/glob Modified Files: Makefile glob.c Log Message: Major realignment to 1.14.7 Index: Makefile =================================================================== RCS file: /cvsroot/winbash/winbash/lib/glob/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Makefile 9 Mar 2002 03:39:13 -0000 1.1.1.1 +++ Makefile 11 Mar 2002 14:32:15 -0000 1.2 @@ -67,7 +67,8 @@ done documentation: force - -(cd doc; $(MAKE) $(MFLAGS)) + -(cd doc && $(MAKE) $(MFLAGS)) + force: # The rule for 'includes' is written funny so that the if statement @@ -80,8 +81,10 @@ clean: rm -f $(OBJECTS) $(LIBRARY_NAME) - -(cd doc; $(MAKE) $(MFLAGS) clean) + -(cd doc && $(MAKE) $(MFLAGS) $@) +maintainer-clean realclean mostlyclean distclean: clean + -(cd doc && $(MAKE) $(MFLAGS) $@) ###################################################################### # # Index: glob.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/glob/glob.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- glob.c 9 Mar 2002 16:05:43 -0000 1.2 +++ glob.c 11 Mar 2002 14:32:15 -0000 1.3 @@ -197,7 +197,6 @@ Return -1 if cannot access directory DIR. Look in errno for more information. */ - char ** glob_vector (pat, dir) char *pat; @@ -436,14 +435,14 @@ if (directories == NULL) goto memory_error; else if (directories == (char **)&glob_error_return) - { - free ((char *)result); - return ((char **) &glob_error_return); - } + { + free ((char *)result); + return ((char **) &glob_error_return); + } else if (*directories == NULL) { free ((char *) directories); - free ((char *) result); + free ((char *) result); return ((char **) &glob_error_return); } |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:19
|
Update of /cvsroot/winbash/winbash/examples/startup-files In directory usw-pr-cvs1:/tmp/cvs-serv6262/examples/startup-files Added Files: Bash_aliases Bash_profile Bashrc bash-profile Log Message: Major realignment to 1.14.7 --- NEW FILE: Bash_aliases --- # Some useful aliases. alias texclean='rm -f *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky' alias clean='echo -n "Really clean this directory?"; read yorn; if test "$yorn" = "y"; then rm -f \#* *~ .*~ *.bak .*.bak *.tmp .*.tmp core a.out; echo "Cleaned."; else echo "Not cleaned."; fi' alias h='history' alias j="jobs -l" alias l="ls -l " alias ll="ls -l" alias ls="ls -F" alias term='set noglob; eval `tset -Q -s `' alias pu="pushd" alias po="popd" # # Csh compatability: # alias unsetenv=unset function setenv () { export $1="$2" } # Function which adds an alias to the current shell and to # the ~/.bash_aliases file. add-alias () { local name=$1 value="$2" echo alias $name=\'$value\' >>~/.bash_aliases eval alias $name=\'$value\' alias $name } # "repeat" command. Like: # # repeat 10 echo foo repeat () { local count="$1" i; shift; for i in $(seq 1 "$count"); do eval "$@"; done } # Subfunction needed by `repeat'. seq () { local lower upper output; lower=$1 upper=$2; while [ $lower -le $upper ]; do output="$output $lower"; lower=$[ $lower + 1 ]; done; echo $output } --- NEW FILE: Bash_profile --- # Startup file for bash login shells. # default_dir=/usr/local/lib/ if [ "$PS1" ]; then PS1='\u@\h(\#)$ ' ignoreeof=3 fi LOGIN_SHELL=true # If the user has her own init file, then use that one, else use the # canonical one. if [ -f ~/.bashrc ]; then source ~/.bashrc else if [ -f ${default_dir}Bashrc ]; then source ${default_dir}Bashrc; fi fi --- NEW FILE: Bashrc --- if [ "$PS1" != "" ] ; then if [ -f /unix ] ; then alias ls='/bin/ls -CF' alias ll='/bin/ls -lCF' alias dir='/bin/ls -bCalF' else alias ls='/bin/ls -F' alias ll='/bin/ls -lF' alias dir='/bin/ls -balF' fi alias ss="ps -aux" alias mail=/usr/ucb/mail alias dot='ls .[a-zA-Z0-9]*' alias mroe=more alias pwd='echo $PWD' alias pdw='echo $PWD' alias news="xterm -g 80x45 -e rn -e &" alias back='cd $OLDPWD' alias manroff="nroff /usr/lib/tmac/tmac.an.4.3" alias laser="lpr -Palw2" alias lw="lpr -Palw2" alias c="clear" alias m="more" alias j="jobs" if [ -z "$HOST" ] ; then export HOST=`hostname` fi history_control=ignoredups psgrep() { ps -aux | grep $1 | grep -v grep } # # This is a little like `zap' from Kernighan and Pike # pskill() { local pid pid=$(ps -ax | grep $1 | grep -v grep | awk '{ print $1 }') echo -n "killing $1 (process $pid)..." kill -9 $pid echo "slaughtered." } term() { TERM=$1 export TERM tset } cd() { builtin cd $* xtitle $HOST: $PWD } bold() { tput smso } unbold() { tput rmso } if [ -f /unix ] ; then clear() { tput clear } fi rot13() { if [ $# = 0 ] ; then tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]" else tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]" < $1 fi } watch() { if [ $# -ne 1 ] ; then tail -f nohup.out else tail -f $1 fi } # # Remote login passing all 8 bits (so meta key will work) # rl() { rlogin $* -8 } function setenv() { if [ $# -ne 2 ] ; then echo "setenv: Too few arguments" else export $1="$2" fi } function chmog() { if [ $# -ne 4 ] ; then echo "usage: chmog mode owner group file" return 1 else chmod $1 $4 chown $2 $4 chgrp $3 $4 fi } # # Source kshenv for ksh-compatibility definitions # if [ -f ~/.kshenv ] ; then . ~/.kshenv fi fi #end of .bashrc --- NEW FILE: bash-profile --- HOME=/usr/homes/chet MAIL=/usr/homes/chet/mbox MAILCHECK=30 HISTFILE=/usr/homes/chet/.history MACHINE=$(/usr/local/bin/machine) HOST=$(hostname) PATH1=/usr/homes/chet/bin.$MACHINE:/usr/local/bin/gnu: PATH2=/usr/local/bin:/usr/ucb:/bin:/usr/bin/X11:. PATH3=/usr/andrew/bin:/usr/bin:/usr/ibm:/usr/local/bin/mh:/usr/new/bin: PATH=$PATH1:$PATH2:$PATH3 EDITOR=/usr/homes/chet/bin.$MACHINE/ce VISUAL=/usr/homes/chet/bin.$MACHINE/ce FCEDIT=/usr/homes/chet/bin.$MACHINE/ce if [ "$BASH" ] ; then SHELL=$BASH else SHELL=/bin/bash fi if [ "$MACHINE" = "ibm032" ] ; then stty erase ^H fi PAGER=/usr/ucb/more NNTPSERVER=kiwi NS=/nfs/cwjcc/fs1/ns-engr/proj/netsrv/cwpub/proto/src # # Bogus 1003.2 variables. This should really be in /etc/profile # LOGNAME=${USER-$(whoami)} TZ=EST5EDT export HOME ENV VISUAL EDITOR MAIL SHELL PATH TERM export PAGER LESS TERMCAP HISTSZIE HISTFILE export MAIL MAILCHECK HOST HOSTNAME NNTPSERVER NS LOGNAME TZ PS1="${HOST}$ " PS2='> ' export PS1 PS2 umask 022 if [ -f /unix ] ; then stty intr ^c fi if [ -f ~/.bashrc ] ; then . ~/.bashrc fi |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:18
|
Update of /cvsroot/winbash/winbash/examples/scripts In directory usw-pr-cvs1:/tmp/cvs-serv6262/examples/scripts Added Files: adventure.sh bcsh.sh precedence shprompt Log Message: Major realignment to 1.14.7 --- NEW FILE: adventure.sh --- #!/bin/bash # ash -- "Adventure shell" # last edit: 86/04/21 D A Gwyn # SCCS ID: @(#)ash.sh 1.4 OPATH=$PATH ask() { echo -n "$@" '[y/n] ' read ans case "$ans" in y*|Y*) return 0 ;; *) return 1 ;; esac } CAT=${PAGER:-more} ash_inst() { cat <<- EOF Instructions for the Adventure shell Welcome to the Adventure shell! In this exploration of the UNIX file system, I will act as your eyes and hands. As you move around, I will describe whatever is visible and will carry out your commands. The general form of a command is Verb Object Extra_stuff. Most commands pay no attention to the "Extra_stuff", and many do not need an "Object". A typical command is get all which picks up all files in the current "room" (directory). You can find out what you are carrying by typing the command inventory The command "help" results in a full description of all commands that I understand. To quit the Adventure shell, type quit There are UNIX monsters lurking in the background. These are also known as "commands with arguments". Good luck! EOF } ash_help() { echo "I understand the following commands (synonyms in parentheses):" echo "" echo "change OBJECT to NEW_NAME changes the name of the object" echo "clone OBJECT as NEW_NAME duplicates the object" echo "drop OBJECTS leaves the objects in the room" echo "enter (go) PASSAGE takes the labeled passage" echo "examine OBJECTS describes the objects in detail" echo "feed OBJECT to MONSTER stuffs the object into a UNIX monster" echo "get (take) OBJECTS picks up the specified objects" echo "gripe (bug) report a problem with the Adventure shell" echo "help prints this summary" echo "inventory (i) tells what you are carrying" echo "kill (destroy) OBJECTS destroys the objects" echo "look (l) describes the room, including hidden objects" echo "open (read) OBJECT shows the contents of an object" echo "quit (exit) leaves the Adventure shell" echo "resurrect OBJECTS attempts to restore dead objects" echo "steal OBJECT from MONSTER obtains the object from a UNIX monster" echo "throw OBJECT at daemon feeds the object to the printer daemon" echo "up takes the overhead passage" echo "wake MONSTER awakens a UNIX monster" echo "where (w) tells you where you are" echo "xyzzy moves you to your home" } MAINT=ch...@in... PATH=/usr/ucb:/bin:/usr/bin:/usr/local/bin:. export PATH trap 'echo Ouch!' 2 3 #trap '' 18 # disable Berkeley job control ash_lk(){ echo " $1 " | fgrep " $2 " >&- 2>&-; } ash_pr(){ echo $* | tr ' ' '\012' | pr -5 -t -w75 -l$[ ( $# + 4 ) / 5 ]; } ash_rm(){ echo " $1 " | sed -e "s/ $2 / /" -e 's/^ //' -e 's/ $//'; } cd LIM=.limbo # $HOME/$LIM contains "destroyed" objects mkdir $LIM >&- 2>&- KNAP=.knapsack # $HOME/$KNAP contains objects being "carried" if [ ! -d $KNAP ] then mkdir $KNAP >&- 2>&- if [ $? = 0 ] then echo 'You found a discarded empty knapsack.' else echo 'You have no knapsack to carry things in.' exit 1 fi else echo 'One moment while I peek in your old knapsack...' fi kn=`echo \`ls -a $KNAP | sed -e '/^\.$/d' -e '/^\.\.$/d'\`` if ask 'Welcome to the Adventure shell! Do you need instructions?' then ash_inst echo -n 'Type a newline to continue: ' read fi wiz=false cha=false prev=$LIM while : do room=`pwd` if [ $room != $prev ] then if [ $room = $HOME ] then echo 'You are in your own home.' else echo "You have entered $room." fi exs= obs= hexs= hobs= f=false for i in `ls -a` do case $i in .|..) ;; .*) if [ -f $i ] then hobs="$hobs $i" elif [ -d $i ] then hexs="$hexs $i" else f=true fi ;; *) if [ -f $i ] then obs="$obs $i" elif [ -d $i ] then exs="$exs $i" else f=true fi ;; esac done if [ "$obs" ] then echo 'This room contains:' ash_pr $obs else echo 'The room looks empty.' fi if [ "$exs" ] then echo 'There are exits labeled:' ash_pr $exs echo 'as well as a passage overhead.' else echo 'There is a passage overhead.' fi if sh -c $f then echo 'There are shadowy figures in the corner.' fi prev=$room fi echo -n '-advsh> ' # prompt read verb obj x if [ $? != 0 ] then verb=quit # EOF fi case $verb in change) if [ "$obj" ] then if ash_lk "$obs $hobs" "$obj" then set -- $x case "$1" in to) if [ "$2" ] then if [ -f $2 ] then echo "You must destroy $2 first." set -- fi if [ "$2" ] then if mv $obj $2 >&- 2>&- then echo "The $obj shimmers and turns into $2." obs=`ash_rm "$2 $obs" "$obj"` else echo "There is a cloud of smoke but the $obj is unchanged." fi fi else echo 'To what?' fi ;; *) echo "Change $obj to what?" ;; esac else if ash_lk "$kn" "$obj" then echo 'You must drop it first.' else echo "I see no $obj here." fi fi else echo 'Change what?' fi ;; clone) if [ "$obj" ] then if ash_lk "$obs $hobs" "$obj" then if [ ! -r $obj ] then echo "The $obj does not wish to be cloned." else set -- $x case "$1" in as) if [ "$2" ] then if [ -f $2 ] then echo "You must destroy $2 first." else if cp $obj $2 >&- 2>&- then echo "Poof! When the smoke clears, you see the new $2." obs="$obs $2" else echo 'You hear a dull thud but no clone appears.' fi fi else echo 'As what?' fi ;; *) echo "Clone $obj as what?" ;; esac fi else if ash_lk "$kn" "$obj" then echo 'You must drop it first.' else echo "I see no $obj here." fi fi else echo 'Clone what?' fi ;; drop) if [ "$obj" ] then for it in $obj $x do if ash_lk "$kn" "$it" then if [ -w $it ] then echo "You must destroy $it first." else if mv $HOME/$KNAP/$it $it >&- 2>&- then echo "$it: dropped." kn=`ash_rm "$kn" "$it"` obs=`echo $it $obs` else echo "The $it is caught in your knapsack." fi fi else echo "You're not carrying the $it!" fi done else echo 'Drop what?' fi ;; enter|go) if [ "$obj" ] then if [ $obj != up ] then if ash_lk "$exs $hexs" "$obj" then if [ -x $obj ] then if cd $obj then echo 'You squeeze through the passage.' else echo "You can't go that direction." fi else echo 'An invisible force blocks your way.' fi else echo 'I see no such passage.' fi else if cd .. then echo 'You struggle upwards.' else echo "You can't reach that high." fi fi else echo 'Which passage?' fi ;; examine) if [ "$obj" ] then if [ $obj = all ] then $obj=`echo $obs $exs` x= fi for it in $obj $x do if ash_lk "$obs $hobs $exs $hexs" "$it" then echo "Upon close inspection of the $it, you see:" ls -ld $it 2>&- if [ $? != 0 ] then echo "-- when you look directly at the $it, it vanishes." fi else if ash_lk "$kn" "$it" then echo 'You must drop it first.' else echo "I see no $it here." fi fi done else echo 'Examine what?' fi ;; feed) if [ "$obj" ] then if ash_lk "$obs $hobs" "$obj" then set -- $x case "$1" in to) if [ "$2" ] then shift if PATH=$OPATH $* <$obj 2>&- then echo "The $1 monster devours your $obj." if rm -f $obj >&- 2>&- then obs=`ash_rm "$obs" "$obj"` else echo 'But he spits it back up.' fi else echo "The $1 monster holds his nose in disdain." fi else echo 'To what?' fi ;; *) echo "Feed $obj to what?" ;; esac else if ash_lk "$kn" "$obj" then echo 'You must drop it first.' else echo "I see no $obj here." fi fi else echo 'Feed what?' fi ;; get|take) if [ "$obj" ] then if [ $obj = all ] then obj="$obs" x= fi for it in $obj $x do if ash_lk "$obs $hobs" "$it" then if ash_lk "$kn" "$it" then echo 'You already have one.' else if mv $it $HOME/$KNAP/$it >&- 2>&- then echo "$it: taken." kn="$it $kn" obs=`ash_rm "$obs" "$it"` else echo "The $it is too heavy." fi fi else echo "I see no $it here." fi done else echo 'Get what?' fi ;; gripe|bug) echo 'Please describe the problem and your situation at the time it failed.\nEnd the bug report with a line containing just a Ctrl-D.' cat | mail $MAINT -s 'ash bug' echo 'Thank you!' ;; help) ash_help ;; inventory|i) if [ "$kn" ] then echo 'Your knapsack contains:' ash_pr $kn else echo 'You are poverty-stricken.' fi ;; kill|destroy) if [ "$obj" ] then if [ $obj = all ] then x= if ask "Do you really want to attempt to $verb them all?" then obj=`echo $obs` else echo 'Chicken!' obj= fi fi for it in $obj $x do if ash_lk "$obs $hobs" "$it" then if mv $it $HOME/$LIM <&- >&- 2>&- then if [ $verb = kill ] then echo "The $it cannot defend himself; he dies." else echo "You have destroyed the $it; it vanishes." fi obs=`ash_rm "$obs" "$it"` else if [ $verb = kill ] then echo "Your feeble blows are no match for the $it." else echo "The $it is indestructible." fi fi else if ash_lk "$kn" "$it" then echo "You must drop the $it first." found=false else echo "I see no $it here." fi fi done else echo 'Kill what?' fi ;; look|l) obs=`echo $obs $hobs` hobs= if [ "$obs" ] then echo 'The room contains:' ash_pr $obs else echo 'The room is empty.' fi exs=`echo $exs $hexs` hexs= if [ "$exs" ] then echo 'There are exits plainly labeled:' ash_pr $exs echo 'and a passage directly overhead.' else echo 'The only exit is directly overhead.' fi ;; magic) if [ "$obj" = mode ] then if sh -c $cha then echo 'You had your chance and you blew it.' else if ask 'Are you a wizard?' then echo -n 'Prove it! Say the magic word: ' read obj if [ "$obj" = armadillo ] then echo 'Yes, master!!' wiz=true else echo "Homie says: I don't think so" cha=true fi else echo "I didn't think so." fi fi else echo 'Nice try.' fi ;; open|read) if [ "$obj" ] then if ash_lk "$obs $hobs" "$obj" then if [ -r $obj ] then if [ -s $obj ] then echo "Opening the $obj reveals:" $CAT < $obj if [ $? != 0 ] then echo '-- oops, you lost the contents!' fi else echo "There is nothing inside the $obj." fi else echo "You do not have the proper tools to open the $obj." fi else if ash_lk "$kn" "$obj" then echo 'You must drop it first.' found=false else echo "I see no $obj here." fi fi else echo 'Open what?' fi ;; quit|exit) if ask 'Do you really want to quit now?' then if [ "$kn" ] then echo 'The contents of your knapsack will still be there next time.' fi rm -rf $HOME/$LIM echo 'See you later!' exit 0 fi ;; resurrect) if [ "$obj" ] then for it in $obj $x do if ash_lk "$obs $hobs" "$it" then echo "The $it is already alive and well." else if mv $HOME/$LIM/$it $it <&- >&- 2>&- then echo "The $it staggers to his feet." obs=`echo $it $obs` else echo "There are sparks but no $it appears." fi fi done else echo 'Resurrect what?' fi ;; steal) if [ "$obj" ] then if ash_lk "$obs $hobs" "$obj" then echo 'There is already one here.' else set -- $x case "$1" in from) if [ "$2" ] then shift if PATH=$OPATH $* >$obj 2>&- then echo "The $1 monster drops the $obj." obs=`echo $obj $obs` else echo "The $1 monster runs away as you approach." rm -f $obj >&- 2>&- fi else echo 'From what?' fi ;; *) echo "Steal $obj from what?" ;; esac fi else echo 'Steal what?' fi ;; throw) if [ "$obj" ] then if ash_lk "$obs $hobs" "$obj" then set -- $x case "$1" in at) case "$2" in daemon) if sh -c "lpr -r $obj" then echo "The daemon catches the $obj, turns it into paper,\nand leaves it in the basket." obs=`ash_rm "$obs" "$obj"` else echo "The daemon is nowhere to be found." fi ;; *) echo 'At what?' ;; esac ;; *) echo "Throw $obj at what?" ;; esac else if ash_lk "$kn" "$obj" then echo 'It is in your knapsack.' found=false else echo "I see no $obj here." fi fi else echo 'Throw what?' fi ;; u|up) if cd .. then echo 'You pull yourself up a level.' else echo "You can't reach that high." fi ;; wake) if [ "$obj" ] then echo "You awaken the $obj monster:" PATH=$OPATH $obj $x echo 'The monster slithers back into the darkness.' else echo 'Wake what?' fi ;; w|where) echo "You are in $room." ;; xyzzy) if cd then echo 'A strange feeling comes over you.' else echo 'Your spell fizzles out.' fi ;; *) if [ "$verb" ] then if sh -c $wiz then PATH=$OPATH $verb $obj $x else echo "I don't know how to \"$verb\"." echo 'Type "help" for assistance.' fi else echo 'Say something!' fi ;; esac done --- NEW FILE: bcsh.sh --- # 1-Feb-86 09:37:35-MST,30567;000000000001 # Return-Path: <uni...@BR...> # Received: from BRL-TGR.ARPA by SIMTEL20.ARPA with TCP; Sat 1 Feb 86 09:36:16-MST # Received: from usenet by TGR.BRL.ARPA id a002623; 1 Feb 86 9:33 EST # From: chris <chris@globetek.uucp> # Newsgroups: net.sources # Subject: Improved Bcsh (Bourne Shell Cshell-Emulator) # Message-ID: <219@globetek.UUCP> # Date: 30 Jan 86 17:34:26 GMT # To: uni...@BR... # # This is a new, improved version of my Bourne shell cshell-emulator. # The code has been cleaned up quite a bit, and a couple of new features # added (now supports 'noclobber' and 'iclobber' variables). A bug with # 'eval' that caused "illegal I/O" error messages on vanilla V7 shells has # also been fixed. # I have posted the program in its entirety because a context diff of the # old and new versions was longer than the new version... [...1215 lines suppressed...] esac # The next commented-out line sets the prompt to include the command # number -- you should only un-comment this if it is the ONLY thing # you ever want as your prompt, because it will override attempts # to set PS1 from the command level. If you want the command number # in your prompt without sacrificing the ability to change the prompt # later, replace the default setting for PS1 before the beginning of # the main loop with the following: PS1='echo -n "${cmdno}% "' # Doing it this way is, however, slower than the simple version below. PS1="${cmdno}% " getcmd=yes echoit=no exclaim=no done exit 0 # Christine Robertson {linus, ihnp4, decvax}!utzoo!globetek!chris --- NEW FILE: precedence --- # @(#)precedence_test 1.0 91/07/24 Maarten Litmaath # test of relative precedences for `&&' and `||' operators echo "\`Say' echos its argument. Its return value is of no interest." case `echo -n` in '') Say () { echo -n "$*" ; } ;; *) Say () { echo "$*\c" ; } ;; esac echo "\`Truth' echos its argument and returns a TRUE result." Truth () { Say $1; return 0; } echo "\`False' echos its argument and returns a FALSE result." False () { Say $1; return 1; } echo "" cmd1='$open $test1 && $test2 $close || $test3' cmd2='$test1 || $open $test2 && $test3 $close' grouping_sh= grouping_C='( )' test3='Say 3' for i in 1 2 do eval proto=\$cmd$i for test1 in 'Truth 1' 'False 1' do for test2 in 'Truth 2' 'False 2' do for precedence in sh C do eval set x \$grouping_$precedence shift open=${1-' '} close=${2-' '} eval cmd=\""$proto"\" Say "$cmd output=" output=`eval "$cmd"` Say "$output" read correct || { echo 'Input fubar. Abort.' >&2; exit 1; } test "X$output" = "X$correct" || echo " correct=$correct" echo '' done echo '' done done done << EOF 12 12 123 123 13 13 13 13 13 1 13 1 123 123 12 12 EOF --- NEW FILE: shprompt --- # # shprompt -- give a prompt and get an answer satisfying certain criteria # # shprompt [-dDfFsy] prompt # s = prompt for string # f = prompt for filename # F = prompt for full pathname to a file or directory # d = prompt for a directory name # D = prompt for a full pathname to a directory # y = prompt for y or n answer # # Chet Ramey # ch...@in... type=file OPTS=dDfFsy succeed() { echo "$1" exit 0 } while getopts "$OPTS" c do case "$c" in s) type=string ;; f) type=file ;; F) type=path ;; d) type=dir ;; D) type=dirpath ;; y) type=yesno ;; ?) echo "usage: $0 [-$OPTS] prompt" 1>&2 exit 2 ;; esac done if [ "$OPTIND" -gt 1 ] ; then shift $[$OPTIND - 1] fi while : do case "$type" in string) echo -n "$1" 1>&2 read ans || exit 1 if [ -n "$ans" ] ; then succeed "$ans" fi ;; file|path) echo -n "$1" 1>&2 read ans || exit 1 # # use `fn' and eval so that bash will do tilde expansion for # me # eval fn="$ans" case "$fn" in /*) if test -e "$fn" ; then succeed "$fn" else echo "$0: '$fn' does not exist" 1>&2 fi ;; *) if [ "$type" = "path" ] ; then echo "$0: must give full pathname to file" 1>&2 else if test -e "$fn" ; then succeed "$fn" else echo "$0: '$fn' does not exist" 1>&2 fi fi ;; esac ;; dir|dirpath) echo -n "$1" 1>&2 read ans || exit 1 # # use `fn' and eval so that bash will do tilde expansion for # me # eval fn="$ans" case "$fn" in /*) if test -d "$fn" ; then succeed "$fn" elif test -e "$fn" ; then echo "$0 '$fn' is not a directory" 1>&2 else echo "$0: '$fn' does not exist" 1>&2 fi ;; *) if [ "$type" = "dirpath" ] ; then echo "$0: must give full pathname to directory" 1>&2 else if test -d "$fn" ; then succeed "$fn" elif test -e "$fn" ; then echo "$0 '$fn' is not a directory" 1>&2 else echo "$0: '$fn' does not exist" 1>&2 fi fi ;; esac ;; yesno) echo -n "$1" 1>&2 read ans || exit 1 case "$ans" in y|Y|[yY][eE][sS]) succeed "yes" ;; n|N|[nN][oO]) succeed "no" exit 0 ;; *) echo "$0: yes or no required" 1>&2 ;; esac ;; esac done exit 1 |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:18
|
Update of /cvsroot/winbash/winbash/examples/functions In directory usw-pr-cvs1:/tmp/cvs-serv6262/examples/functions Added Files: autoload basename csh-compat dirfuncs dirname exitstat external fact fstty func jj.bash kshenv manpage notify.bash shcat substr substr2 term whatis whence Log Message: Major realignment to 1.14.7 --- NEW FILE: autoload --- # # An almost ksh-compatible `autoload'. A function declared as `autoload' will # be read in from a file the same name as the function found by searching the # $FPATH (which works the same as $PATH), then that definition will be run. # # To do this without source support, we define a dummy function that, when # executed, will load the file (thereby re-defining the function), then # execute that newly-redefined function with the original arguments. # # It's not identical to ksh because ksh apparently does lazy evaluation # and looks for the file to load from only when the function is referenced. # This one requires that the file exist when the function is declared as # `autoload'. # # usage: autoload func [func...] # # The first cut of this was by Bill Trost, tr...@re...tnet # # Chet Ramey # ch...@in... # # Declare a function ($1) to be autoloaded from a file ($2) when it is first # called. This defines a `temporary' function that will `.' the file # containg the real function definition, then execute that new definition with # the arguments given to this `fake' function. The autoload function defined # by the file and the file itself *must* be named identically. # aload() { eval $1 '() { . '$2' ; '$1' "$@" ; return $?; }' } # # Search $FPATH for a file the same name as the function given as $1, and # autoload the function from that file. There is no default $FPATH. # autoload() { # # Save the list of functions; we're going to blow away the arguments # in a second. If any of the names contain white space, TFB. # local args="$*" # # This should, I think, list the functions marked as autoload and not # yet defined, but we don't have enough information to do that here. # if [ $# -eq 0 ] ; then echo "usage: autoload function [function...]" return 1 fi # # If there is no $FPATH, there is no work to be done # if [ -z "$FPATH" ] ; then echo autoload: FPATH not set return 1 fi # # This treats FPATH exactly like PATH: a null field anywhere in the # FPATH is treated the same as the current directory. # # The path splitting command is taken from Kernighan and Pike # fp=$(echo $FPATH | sed 's/^:/.:/ s/::/:.:/g s/:$/:./ s/:/ /g') for FUNC in $args ; do # # We're blowing away the arguments to autoload here... # We have to; there are no arrays. # set $fp while [ $# -ne 0 ] ; do if [ -f $1/$FUNC ] ; then break # found it! fi shift done if [ $# -eq 0 ] ; then echo "$FUNC: autoload function not found" continue fi # echo auto-loading $FUNC from $1/$FUNC aload $FUNC $1/$FUNC done return 0 } --- NEW FILE: basename --- # Date: Fri, 11 Oct 91 11:22:36 edt # From: fri...@gn... # To: bf...@gn... # A replacement for basename(1). Not all the systems I use have this # program. Usage: basename [path] {extension} function basename () { local path="$1" local suffix="$2" local tpath="${path%/}" # Strip trailing '/' characters from path (unusual that this should # ever occur, but basename(1) seems to deal with it.) while [ "${tpath}" != "${path}" ]; do tpath="${path}" path="${tpath%/}" done path="${path##*/}" # Strip off pathname echo ${path%${suffix}} # Also strip off extension, if any. } --- NEW FILE: csh-compat --- # C-shell compatabilty package. # setenv VAR VALUE function setenv () { export $1="$2" } function unsetenv () { unset $1 } function alias () { local name=$1 shift local value="$*" if [ "$name" = "" ]; then builtin alias elif [ "$value" = "" ]; then builtin alias $name else builtin alias $name="$value" fi } # Can't write foreach yet. Need pattern matching, and a few extras. function foreach () { echo 'Can'\''t do `foreach'\'' yet. Type "help for".' } # Make this work like csh's. Special case "term" and "path". #set () { #} chdir () { builtin cd $* } --- NEW FILE: dirfuncs --- # # Directory manipulation functions from the book 'The Korn Shell' # Modified for use with bash Mon Apr 18 08:37 1994 by # Ken Konecki (ke...@wf...) # # Modified by Chet Ramey # # This could stand to have calls to `select' added back in # alias integer="declare -i" integer _push_max=${CDSTACK-31} _push_top=${CDSTACK-31} unalias cd # alias cd=_cd # Display directory stack -- $HOME display as ~ dirs() { dir="${PWD#$HOME/}" case $dir in $HOME) dir=\~ ;; /*) ;; *) dir=\~/$dir ;; esac integer i=_push_top integer n=1 echo "$n) $dir" while let "i < $_push_max" do n=n+1 eval "echo \$n\) \$_push_stack_$i" i=i+1 done } # Change directory and put directory on front of stack cd() { typeset dir= integer n=0 type=4 i case $1 in -|-1|2) # cd - n=_push_top type=1 ;; -[1-9]|-[1-9][0-9]) # cd -n n=_push_top+${1#-}-1 type=2 ;; 1) # keep present directory echo "$PWD" return ;; [2-9]|[1-9][0-9]) # cd n n=_push_top+${1}-2 type=2 ;; *) if let "_push_top <= 0"; then type=3 n=_push_max fi ;; esac if let "type < 3"; then if let "n >= _push_max"; then echo cd: Directory stack not that deep return 1 else eval dir=\${_push_stack_$n} fi fi case $dir in ~*) dir=$HOME${dir#\~} ;; esac cd2 ${dir:-$@} > /dev/null || return 1 dir=${OLDPWD#$HOME/} case $dir in $HOME) dir=\~ ;; /*) ;; *) dir=\~/$dir ;; esac case $type in 1) # swap first two elements eval _push_stack_$_push_top=\$dir ;; 2|3) # put $dir on top and shift down by one until top i=_push_top unset _dirlist while let "i < $_push_max" ; do eval _dirlist=\"\$_dirlist \$_push_stack_$i\" i=i+1 done i=_push_top for dir in "$dir" ${_dirlist} ; do let "i > n" && break eval _push_stack_$i=\$dir i=i+1 done ;; 4) # push name _push_top=_push_top-1; eval _push_stack_$_push_top=\$dir ;; esac echo "$PWD" } # Menu-driven change directory command function mcd { dirs echo -n "Select by number or enter a name: " read cd $REPLY } # Emulate ksh cd substitution cd2() { case "$#" in 0) builtin cd "$HOME" ;; 1) builtin cd "$1" ;; 2) newDir=$(echo $PWD | sed -e "s:$1:$2:g") case "$newDir" in $PWD) echo "bash:: cd: bad substitution" >&2 ; return 1 ;; *) builtin cd "$newDir" ;; esac ;; *) echo "bash: cd: wrong arg count" 1>&2 ; return 1 ;; esac } --- NEW FILE: dirname --- # Date: Fri, 11 Oct 91 11:22:36 edt # From: fri...@gn... # To: bf...@gn... # A replacement for dirname(1). This one appears less often on some # systems I use than basename(1), and I really depend on it for some # things. Usage: dirname [path] function dirname () { local dir="$1" local tdir="${dir%/}" # Strip trailing '/' characters from dir (unusual that this should # ever occur, but dirname(1) seems to deal with it.) while [ "${tdir}" != "${dir}" ]; do tdir="${dir}" dir="${tdir%/}" done echo "${dir%/*}" } --- NEW FILE: exitstat --- # Contributed by Noah Friedman and Roland McGrath. # To be run by the PROMPT_COMMAND variable, so that one can see what # the exit status of processes are. function check_exit_status () { local status="$?" local signal="" if [ ${status} -ne 0 -a ${status} != 128 ]; then # If process exited by a signal, determine name of signal. if [ ${status} -gt 128 ]; then signal="$(builtin kill -l $[${status} - 128] 2>/dev/null)" if [ "$signal" ]; then signal="($signal)"; fi fi echo "[Exit ${status} ${signal}]" 1>&2 fi return 0 } PROMPT_COMMAND=check_exit_status --- NEW FILE: external --- # Contributed by Noah Friedman. # To avoid using a function in bash, you can use the `builtin' or # `command' builtins, but neither guarantees that you use an external # program instead of a bash builtin if there's a builtin by that name. So # this function can be used like `command' except that it guarantees the # program is external by first disabling any builtin by that name. After # the command is done executing, the state of the builtin is restored. function external () { local state="" local exit_status if builtin_p "$1"; then state="builtin" enable -n "$1" fi command "$@" exit_status=$? if [ "$state" = "builtin" ]; then enable "$1" fi return ${exit_status} } # What is does is tell you if a particular keyword is currently enabled as # a shell builtin. It does NOT tell you if invoking that keyword will # necessarily run the builtin. For that, do something like # # test "$(builtin type -type [keyword])" = "builtin" # # Note also, that disabling a builtin with "enable -n" will make builtin_p # return false, since the builtin is no longer available. function builtin_p () { local word set $(builtin type -all -type "$1") for word in "$@" ; do if [ "${word}" = "builtin" ]; then return 0 fi done return 1 } --- NEW FILE: fact --- # Who said shells can't use recursion? Here is a factorial function. # You call it with a number as an argument, and it returns the factorial # of that number. fact () { local num=$1; if [ "$num" = 1 ] ; then echo 1 return ; fi; echo $[ $num * $(fact $[ $num - 1 ])] } --- NEW FILE: fstty --- # # A function that works as a front end for both stty and the `bind' # builtin, so the tty driver and readline see the same changes # # # Convert between the stty ^H control character form and the readline \C-H # form # cvt() { echo "$@" | cat -v | sed 's/\^/\\C-/' } # # stty front-end. Parses the argument list and creates two command strings, # one for stty, another for bind. # fstty() { local cmd="" bargs="" local e while [ $# -gt 0 ] do case "$1" in -a) cmd="$cmd everything" ;; erase) shift; e=$(cvt "$1") cmd="$cmd erase $1" bargs="$bargs '\"$e\": backward-delete-char'" ;; kill) shift e=$(cvt "$1") cmd="$cmd kill $1" bargs="$bargs '\"$e\": unix-line-discard'" ;; werase) shift; e=$(cvt "$1") cmd="$cmd erase $1" bargs="$bargs '\"$e\": backward-kill-word'" ;; lnext) shift; e=$(cvt "$1") cmd="$cmd erase $1" bargs="$bargs '\"$e\": quoted-insert'" ;; *) cmd="$cmd $1" ;; esac shift done command stty $cmd if [ -n "$bargs" ]; then builtin bind $bargs fi } --- NEW FILE: func --- # # func -- print out definitions for functions named by arguments # # usage: func name [name ...] # # Chet Ramey # ch...@in... func() { local status=0 if [ $# -eq 0 ] ; then echo "usage: func name [name...]" 1>&2 return 1 fi for f do if [ "$(builtin type -type $f)" != "function" ] ; then echo "func: $f: not a function" 1>&2 status=1 # one failed continue fi builtin type $f | sed 1d done return $status } --- NEW FILE: jj.bash --- jj () { p=$(jobs $1); echo $p case "$p" in [*) echo matches '[*' ;; *) echo not a match\? ;; esac } --- NEW FILE: kshenv --- # # .kshenv -- functions and aliases to provide the beginnings of a ksh # environment for bash. # # Chet Ramey # ch...@in... # # # These are definitions for the ksh compiled-in `exported aliases'. There # are others, but we already have substitutes for them: "history", "type", # and "hash". # alias r="fc -e -" alias functions="typeset -f" alias integer="typeset -i" alias nohup="nohup " alias true=":" alias false="let 0" alias hist="fc" # # An almost-ksh compatible `whence' command. This is as hairy as it is # because of the desire to exactly mimic ksh (whose behavior was determined # empirically). # # This depends somewhat on knowing the format of the output of the bash # `builtin type' command. # whence() { local vflag local path vflag= path= if [ "$#" = "0" ] ; then echo "whence: argument expected" return 1 fi case "$1" in -v) vflag=1 shift 1 ;; -*) echo "whence: bad option: $1" return 1 ;; *) ;; esac if [ "$#" = "0" ] ; then echo "whence: bad argument count" return 1 fi for cmd do if [ "$vflag" ] ; then echo $(builtin type $cmd | sed 1q) else path=$(builtin type -path $cmd) if [ "$path" ] ; then echo $path else case "$cmd" in /*) echo "" ;; *) case "$(builtin type -type $cmd)" in "") echo "" ;; *) echo "$cmd" ;; esac ;; esac fi fi done return 0 } # # For real ksh homeboy fanatics, redefine the `type' builtin with a ksh # version. # #type() #{ # whence -v "$*" #} cd() { case $# in 0) builtin cd "$HOME" ;; 1) builtin cd "$@" ;; 2) old="$1" new="$2" dir=$(echo "$PWD" | sed "s:$old:$new:g") case "$dir" in "$PWD") echo "bash: cd: bad substitution" >&2 ; return 1 ;; *) echo "$dir" builtin cd "$dir" ;; esac ;; *) echo "cd: wrong arg count" >&2 ; return 1 ;; esac } # # ksh print emulation # # print [-Rnprsu[n]] [arg ...] # # - end of options # -R BSD-style -- only accept -n, no escapes # -n do not add trailing newline # -p no-op (no coprocesses) # -r no escapes # -s no-op (print to the history file) # -u n redirect output to fd n # print() { local eflag=-e local nflag= local fd=1 OPTIND=1 while getopts "Rnprsu:" c do case $c in R) eflag= ;; r) eflag= ;; n) nflag=-n ;; u) fd=$OPTARG ;; p|s) ;; esac done shift $[ $OPTIND - 1 ] builtin echo $eflag $nflag "$@" >&$fd } # substring function # this function should be equivalent to the substring built-in which was # eliminated after the 06/29/84 version substring () { local lpat flag str #local variables set -f case $1 in -l|-L) flag=$1 lpat=$2 shift 2 ;; esac # test for too few or too many arguments if [ x"$1" = x -o $# -gt 2 ]; then print -u2 'substring: bad argument count' return 1 fi str=$1 if [ x"$flag" = x-l ]; then #substring -l lpat str=${str#$lpat} elif [ x"$flag" = x-L ]; then str=${str##$lpat} #substring -L lpat fi if [ x"$2" != x ]; then echo ${str%$2} else echo $str fi return 0 } --- NEW FILE: manpage --- # Written from scratch by Tom Tromey (tr...@cn...) # # manpage -- find and print a manual page. # usage: manpage section name [printing] # function manpage () { local i h cmd zot sec local num="$1" local page="$2" local printing="$3" local mp mp="${MANPATH:-/usr/man}" if [ "$#" -lt 2 ]; then return 1; fi # should print usage if [ "$num" != "" ]; then sec="${num%%[a-zA-Z]*}" else sec='[168234571lnpo]' num="$sec" fi for i in $(echo "$mp" | tr : ' '); do if [ ! -d "$i" ]; then continue; fi file="$i"/man"$sec"/"$page"."$num"* set $file file="$1" if [ -f "$file" ]; then zot=$(head -1 "$file") cmd=${MANROFF:-"nroff -man - | col | cat -s"} h=${zot##"'"'\"'} if [ "$h" != "$zot" ]; then while [ "$h" != "" ]; do case "$h" in *e) cmd="${MANEQN:-neqn} | $cmd";; *r) cmd="refer | $cmd";; *t) cmd="tbl | $cmd";; *v) cmd="vgrind | $cmd";; *) ;; # should print error esac h=${h%?} done fi if [ "$printing" != "" ]; then (cd "$i"; eval "$cmd") < "$file" | ${PAGER:-more} else (cd "$i"; eval "$cmd") < "$file" > /tmp/manpage-$$ ${PAGER:-more} /tmp/manpage-$$ rm -f /tmp/manpage-$$ fi break fi done } function whatis_internal () { local j for j in $(echo "$MANPATH" | tr : ' '); do if [ -f "$j/whatis" ]; then eval $2 -i -e "$1" $j/whatis fi done } function whatis () { local name=$(basename "$1") whatis_internal "$name" "grep -w" } function apropos () { whatis_internal "$1" "fgrep" } # Note: "-" and "-t" together not supported. This man could be # made a lot better, but it does everything I want. function man () { local PAGER printing mpath MANROFF num mpath="${MANPATH:-/usr/man}" while true; do case "$1" in -) PAGER=cat printing= ;; -t) MANROFF=${TROFF:-"ptroff -man -t"} PAGER="${TCAT:-lpr}" printing=yes ;; -M) mpath="$2" shift;; *) break;; esac shift done local MANPATH="$mpath" case "$1" in -f | -k) local g a if [ "$1" = "-f" ]; then g="grep -w" a=$(basename "$2") else g=fgrep a="$2" fi whatis_internal "$a" "$g" ;; [0-9npol] | [0-9][a-z]* | new | public | old | local) if [ "$1" = "new" ]; then num=n elif [ "$1" = "public" ]; then num=p elif [ "$1" = "old" ]; then num=o elif [ "$1" = "local" ]; then num=l else num="$1" fi shift manpage "$num" "$1" "$printing" ;; *) manpage "$num" "$1" "$printing" ;; esac } --- NEW FILE: notify.bash --- trap _notify CHLD NOTIFY_ALL=false unset NOTIFY_LIST unalias false false() { return 1 } _notify () { local i j local newlist= if $NOTIFY_ALL then return # let bash take care of this itself elif [ -z "$NOTIFY_LIST" ]; then return else set -- $NOTIFY_LIST for i in "$@" do j=$(jobs -n %$i) if [ -n "$j" ]; then echo "$j" jobs -n %$i >/dev/null else newlist="newlist $i" fi done NOTIFY_LIST="$newlist" fi } notify () { local i j if [ $# -eq 0 ]; then NOTIFY_ALL=: set -b return else for i in "$@" do # turn a valid job spec into a job number j=$(jobs $i) case "$j" in [*) j=${j%%]*} j=${j#[} NOTIFY_LIST="$NOTIFY_LIST $j" ;; esac done fi } --- NEW FILE: shcat --- shcat() { while read line do echo "$line" done } --- NEW FILE: substr --- # # substr -- a function to emulate the ancient ksh builtin # # # -l == shortest from left # -L == longest from left # -r == shortest from right (the default) # -R == longest from right substr() { local flag pat str local usage="usage: substr -lLrR pat string or substr string pat" case "$1" in -l | -L | -r | -R) flag="$1" pat="$2" shift 2 ;; -*) echo "substr: unknown option: $1" echo "$usage" return 1 ;; *) flag="-r" pat="$2" ;; esac if [ "$#" -eq 0 -o "$#" -gt 2 ] ; then echo "substr: bad argument count" return 2 fi str="$1" # # We don't want -f, but we don't want to turn it back on if # we didn't have it already # case "$-" in "*f*") ;; *) fng=1 set -f ;; esac case "$flag" in -l) str="${str#$pat}" # substr -l pat string ;; -L) str="${str##$pat}" # substr -L pat string ;; -r) str="${str%$pat}" # substr -r pat string ;; -R) str="${str%%$pat}" # substr -R pat string ;; *) str="${str%$2}" # substr string pat ;; esac echo "$str" # # If we had file name generation when we started, re-enable it # if [ "$fng" = "1" ] ; then set +f fi } --- NEW FILE: substr2 --- # # substr -- a function to emulate the ancient ksh builtin # # -l == remove shortest from left # -L == remove longest from left # -r == remove shortest from right (the default) # -R == remove longest from right substr() { local flag pat str local usage="usage: substr -lLrR pat string or substr string pat" local options="l:L:r:R:" OPTIND=1 while getopts "$options" c do case "$c" in l | L | r | R) flag="-$c" pat="$OPTARG" ;; '?') echo "$usage" return 1 ;; esac done if [ "$OPTIND" -gt 1 ] ; then shift $[ $OPTIND -1 ] fi if [ "$#" -eq 0 -o "$#" -gt 2 ] ; then echo "substr: bad argument count" return 2 fi str="$1" # # We don't want -f, but we don't want to turn it back on if # we didn't have it already # case "$-" in "*f*") ;; *) fng=1 set -f ;; esac case "$flag" in -l) str="${str#$pat}" # substr -l pat string ;; -L) str="${str##$pat}" # substr -L pat string ;; -r) str="${str%$pat}" # substr -r pat string ;; -R) str="${str%%$pat}" # substr -R pat string ;; *) str="${str%$2}" # substr string pat ;; esac echo "$str" # # If we had file name generation when we started, re-enable it # if [ "$fng" = "1" ] ; then set +f fi } --- NEW FILE: term --- # # term -- a shell function to set the terminal type interactively or not. # term() { local t if [ $# != 0 ] ; then eval $(tset -sQ $1) else # interactive if [ -z "$TERM" ] ; then TERM="unknown" fi case "$TERM" in network|dialup|unknown|lat) TERM=unknown ;; *) eval $(tset -sQ) ;; esac while [ "$TERM" = "unknown" ] ; do echo -n "Terminal type: " read t if [ -n "$t" ] ; then eval $(tset -sQ $t) fi done fi } --- NEW FILE: whatis --- # # whatis -- and implementation of the 10th Edition Unix sh builtin `whatis' # command. # # usage: whatis arg [...] # # For each argument, whatis prints the associated value as a parameter, # builtin, function, alias, or executable file as appropriate. In each # case, the value is printed in a form which would yield the same value # if typed as input to the shell itself. # whatis() { local wusage='usage: whatis arg [arg...]' local fail=0 if [ $# -eq 0 ] ; then echo "$wusage" return 1 fi for arg do case $(builtin type -type $arg 2>/dev/null) in "alias") builtin alias "$arg" ;; "function") builtin type "$arg" | sed 1d ;; "builtin") echo builtin "$arg" ;; "file") builtin type -path "$arg" ;; *) # OK, we could have a variable, or we could have nada if [ "$(eval echo \${$arg+set})" = "set" ] ; then # It is a variable, and it is set echo -n "$arg=" eval echo '\"'\$$arg'\"' else echo whatis: $arg: not found fail=1 fi ;; esac done return $fail } --- NEW FILE: whence --- # # An almost-ksh compatible `whence' command. This is as hairy as it is # because of the desire to exactly mimic ksh. # # This depends somewhat on knowing the format of the output of the bash # `builtin type' command. # # Chet Ramey # ch...@in... # whence() { local vflag= path= if [ "$#" = "0" ] ; then echo "whence: argument expected" return 1 fi case "$1" in -v) vflag=1 shift 1 ;; -*) echo "whence: bad option: $1" return 1 ;; *) ;; esac if [ "$#" = "0" ] ; then echo "whence: bad argument count" return 1 fi for cmd do if [ "$vflag" ] ; then echo $(builtin type $cmd | sed 1q) else path=$(builtin type -path $cmd) if [ "$path" ] ; then echo $path else case "$cmd" in /*) if [ -x "$cmd" ]; then echo "$cmd" fi ;; *) case "$(builtin type -type $cmd)" in "") ;; *) echo "$cmd" ;; esac ;; esac fi fi done return 0 } |
From: Enrico B. <enr...@us...> - 2002-03-11 14:32:16
|
Update of /cvsroot/winbash/winbash/CWRU/misc In directory usw-pr-cvs1:/tmp/cvs-serv6262/CWRU/misc Added Files: aux-mach-desc bison open-files.c pid.c sigs.c sigstat.c Log Message: Major realignment to 1.14.7 --- NEW FILE: aux-mach-desc --- /* ************************ */ /* */ /* A/UX 3.0 System */ /* */ /* ************************ */ #if defined (mc68k32) && !defined (M_MACHINE) # define M_MACHINE "Macintosh" # define M_OS "AUX" # define SYSDEP_CFLAGS -ZP -DUSG -DHAVE_BCOPY -DHAVE_UID_T -DNSIG=32 \ -DHAVE_GETDTABLESIZE # define SYSDEP_LDFLAGS -ZP # define HAVE_DIRENT # define HAVE_POSIX_SIGNALS # define HAVE_VFPRINTF # define VOID_SIGHANDLER # define HAVE_GETGROUPS # undef HAVE_RESOURCE # undef HAVE_ALLOCA # define REQUIRED_LIBRARIES -lc_s #endif /* A/UX */ --- NEW FILE: bison --- #! /bin/sh if [ "$1" = '-y' ]; then shift fi exec /usr/bin/yacc ${1+"$@"} --- NEW FILE: open-files.c --- #include <sys/types.h> #include <fcntl.h> #include <sys/file.h> #include <stdio.h> main() { register int i; for (i = 0; i < getdtablesize(); i++) { if (fcntl(i, F_GETFD, 0) != -1) fprintf(stderr, "fd %d: open\n", i); } exit(0); } --- NEW FILE: pid.c --- #include <stdio.h> main() { fprintf(stderr, "%d\n", getpid()); exit(0); } --- NEW FILE: sigs.c --- #include <signal.h> #include <stdio.h> extern char *sys_siglist[]; typedef void sighandler(); main(argc, argv) int argc; char **argv; { register int i; sighandler *h; for (i = 1; i < NSIG; i++) { h = signal(i, SIG_DFL); if (h != SIG_DFL) { if (h == SIG_IGN) fprintf(stderr, "%d: ignored (%s)\n", i, sys_siglist[i]); else fprintf(stderr, "%d: caught (%s)\n", i, sys_siglist[i]); } } exit(0); } --- NEW FILE: sigstat.c --- /* * sigstat - print out useful information about signal arguments * */ #include <sys/types.h> #include <signal.h> #include <stdio.h> extern char *strrchr(); static char *signames[NSIG]; char *progname; void sigstat(); main(argc, argv) int argc; char **argv; { register int i; char *t; if (t = strrchr(argv[0], '/')) progname = ++t; else progname = argv[0]; init_signames(); if (argc == 1) { for (i = 1; i < NSIG; i++) sigstat(i); exit(0); } for (i = 1; i < argc; i++) sigstat(atoi(argv[i])); exit(0); } void sigstat(sig) int sig; { struct sigaction oact; char *signame; sigset_t set, oset; int blocked; if (sig < 0 || sig >= NSIG) { fprintf(stderr, "%s: %d: signal out of range\n", progname, sig); return; } signame = signames[sig]; sigemptyset(&oset); sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset); if (sigismember(&oset, sig)) printf("%s: signal is blocked\n", signame); sigaction(sig, (struct sigaction *)NULL, &oact); if (oact.sa_handler == SIG_IGN) printf("%s: signal is ignored\n", signame); else if (oact.sa_handler == SIG_DFL) printf("%s: signal is defaulted\n", signame); else printf("%s: signal is trapped (?)\n", signame); } init_signames() { register int i; bzero(signames, sizeof(signames)); #if defined (SIGHUP) /* hangup */ signames[SIGHUP] = "SIGHUP"; #endif #if defined (SIGINT) /* interrupt */ signames[SIGINT] = "SIGINT"; #endif #if defined (SIGQUIT) /* quit */ signames[SIGQUIT] = "SIGQUIT"; #endif #if defined (SIGILL) /* illegal instruction (not reset when caught) */ signames[SIGILL] = "SIGILL"; #endif #if defined (SIGTRAP) /* trace trap (not reset when caught) */ signames[SIGTRAP] = "SIGTRAP"; #endif #if defined (SIGABRT) /* */ signames[SIGABRT] = "SIGABRT"; #endif #if defined (SIGIOT) /* IOT instruction */ signames[SIGIOT] = "SIGIOT"; #endif #if defined (SIGEMT) /* EMT instruction */ signames[SIGEMT] = "SIGEMT"; #endif #if defined (SIGFPE) /* floating point exception */ signames[SIGFPE] = "SIGFPE"; #endif #if defined (SIGKILL) /* kill (cannot be caught or ignored) */ signames[SIGKILL] = "SIGKILL"; #endif #if defined (SIGBUS) /* bus error */ signames[SIGBUS] = "SIGBUS"; #endif #if defined (SIGSEGV) /* segmentation violation */ signames[SIGSEGV] = "SIGSEGV"; #endif #if defined (SIGSYS) /* bad argument to system call */ signames[SIGSYS] = "SIGSYS"; #endif #if defined (SIGPIPE) /* write on a pipe with no one to read it */ signames[SIGPIPE] = "SIGPIPE"; #endif #if defined (SIGALRM) /* alarm clock */ signames[SIGALRM] = "SIGALRM"; #endif #if defined (SIGTERM) /* software termination signal from kill */ signames[SIGTERM] = "SIGTERM"; #endif #if defined (SIGCLD) /* Like SIGCHLD. */ signames[SIGCLD] = "SIGCLD"; #endif #if defined (SIGPWR) /* Magic thing for some machines. */ signames[SIGPWR] = "SIGPWR"; #endif #if defined (SIGPOLL) /* For keyboard input? */ signames[SIGPOLL] = "SIGPOLL"; #endif #if defined (SIGURG) /* urgent condition on IO channel */ signames[SIGURG] = "SIGURG"; #endif #if defined (SIGSTOP) /* sendable stop signal not from tty */ signames[SIGSTOP] = "SIGSTOP"; #endif #if defined (SIGTSTP) /* stop signal from tty */ signames[SIGTSTP] = "SIGTSTP"; #endif #if defined (SIGCONT) /* continue a stopped process */ signames[SIGCONT] = "SIGCONT"; #endif #if defined (SIGCHLD) /* to parent on child stop or exit */ signames[SIGCHLD] = "SIGCHLD"; #endif #if defined (SIGTTIN) /* to readers pgrp upon background tty read */ signames[SIGTTIN] = "SIGTTIN"; #endif #if defined (SIGTTOU) /* like TTIN for output if (tp->t_local<OSTOP) */ signames[SIGTTOU] = "SIGTTOU"; #endif #if defined (SIGIO) /* input/output possible signal */ signames[SIGIO] = "SIGIO"; #endif #if defined (SIGXCPU) /* exceeded CPU time limit */ signames[SIGXCPU] = "SIGXCPU"; #endif #if defined (SIGXFSZ) /* exceeded file size limit */ signames[SIGXFSZ] = "SIGXFSZ"; #endif #if defined (SIGVTALRM) /* virtual time alarm */ signames[SIGVTALRM] = "SIGVTALRM"; #endif #if defined (SIGPROF) /* profiling time alarm */ signames[SIGPROF] = "SIGPROF"; #endif #if defined (SIGWINCH) /* window changed */ signames[SIGWINCH] = "SIGWINCH"; #endif #if defined (SIGLOST) /* resource lost (eg, record-lock lost) */ signames[SIGLOST] = "SIGLOST"; #endif #if defined (SIGUSR1) /* user defined signal 1 */ signames[SIGUSR1] = "SIGUSR1"; #endif #if defined (SIGUSR2) /* user defined signal 2 */ signames[SIGUSR2] = "SIGUSR2"; #endif #if defined (SIGMSG) /* HFT input data pending */ signames[SIGMSG] = "SIGMSG"; #endif #if defined (SIGPWR) /* power failure imminent (save your data) */ signames[SIGPWR] = "SIGPWR"; #endif #if defined (SIGDANGER) /* system crash imminent */ signames[SIGDANGER] = "SIGDANGER"; #endif #if defined (SIGMIGRATE) /* migrate process to another CPU */ signames[SIGMIGRATE] = "SIGMIGRATE"; #endif #if defined (SIGPRE) /* programming error */ signames[SIGPRE] = "SIGPRE"; #endif #if defined (SIGGRANT) /* HFT monitor mode granted */ signames[SIGGRANT] = "SIGGRANT"; #endif #if defined (SIGRETRACT) /* HFT monitor mode retracted */ signames[SIGRETRACT] = "SIGRETRACT"; #endif #if defined (SIGSOUND) /* HFT sound sequence has completed */ signames[SIGSOUND] = "SIGSOUND"; #endif for (i = 0; i < NSIG; i++) if (signames[i] == (char *)NULL) { signames[i] = (char *)malloc (16);; sprintf (signames[i], "signal %d", i); } } |
From: Enrico B. <enr...@us...> - 2002-03-11 14:27:41
|
Update of /cvsroot/winbash/winbash/examples/startup-files In directory usw-pr-cvs1:/tmp/cvs-serv4887/startup-files Log Message: Directory /cvsroot/winbash/winbash/examples/startup-files added to the repository |
From: Enrico B. <enr...@us...> - 2002-03-11 14:27:40
|
Update of /cvsroot/winbash/winbash/examples/scripts In directory usw-pr-cvs1:/tmp/cvs-serv4887/scripts Log Message: Directory /cvsroot/winbash/winbash/examples/scripts added to the repository |
From: Enrico B. <enr...@us...> - 2002-03-11 14:27:40
|
Update of /cvsroot/winbash/winbash/examples/functions In directory usw-pr-cvs1:/tmp/cvs-serv4887/functions Log Message: Directory /cvsroot/winbash/winbash/examples/functions added to the repository |
From: Enrico B. <enr...@us...> - 2002-03-11 14:26:27
|
Update of /cvsroot/winbash/winbash/CWRU/misc In directory usw-pr-cvs1:/tmp/cvs-serv4516/misc Log Message: Directory /cvsroot/winbash/winbash/CWRU/misc added to the repository |
From: Enrico B. <enr...@us...> - 2002-03-11 14:24:39
|
Update of /cvsroot/winbash/winbash/tests/misc In directory usw-pr-cvs1:/tmp/cvs-serv3868/misc Log Message: Directory /cvsroot/winbash/winbash/tests/misc added to the repository |
From: Enrico B. <enr...@us...> - 2002-03-11 05:12:57
|
Update of /cvsroot/winbash/winbash In directory usw-pr-cvs1:/tmp/cvs-serv4607 Modified Files: .patchlevel parse.y subst.c version.h Log Message: Applied GNU bash 1.14.7 diffs Index: .patchlevel =================================================================== RCS file: /cvsroot/winbash/winbash/.patchlevel,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- .patchlevel 11 Mar 2002 04:50:29 -0000 1.5 +++ .patchlevel 11 Mar 2002 05:12:52 -0000 1.6 @@ -1 +1 @@ -6 +7 Index: parse.y =================================================================== RCS file: /cvsroot/winbash/winbash/parse.y,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- parse.y 11 Mar 2002 04:50:29 -0000 1.5 +++ parse.y 11 Mar 2002 05:12:52 -0000 1.6 @@ -861,7 +861,7 @@ } else { - int c = current_readline_line[current_readline_line_index++]; + int c = (unsigned char)current_readline_line[current_readline_line_index++]; return (c); } } @@ -905,7 +905,7 @@ static int yy_string_get () { - register char *string; + register unsigned char *string; register int c; string = bash_input.location.string; @@ -953,9 +953,9 @@ if (bash_input.location.file) #if defined (NO_READ_RESTART_ON_SIGNAL) - result = getc_with_restart (bash_input.location.file); + result = (unsigned char)getc_with_restart (bash_input.location.file); #else - result = getc (bash_input.location.file); + result = (unsigned char)getc (bash_input.location.file); #endif /* !NO_READ_RESTART_ON_SIGNAL */ return (result); } Index: subst.c =================================================================== RCS file: /cvsroot/winbash/winbash/subst.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- subst.c 11 Mar 2002 04:50:29 -0000 1.6 +++ subst.c 11 Mar 2002 05:12:52 -0000 1.7 @@ -974,6 +974,7 @@ } *p = '\0'; strcpy (string, nstr); + free (nstr); } /* Perform quoted null character removal on each element of LIST. Index: version.h =================================================================== RCS file: /cvsroot/winbash/winbash/version.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- version.h 11 Mar 2002 04:56:11 -0000 1.8 +++ version.h 11 Mar 2002 05:12:52 -0000 1.9 @@ -5,12 +5,12 @@ #define DISTVERSION "1.14" /* The patch level of this version of the shell. */ -#define PATCHLEVEL 6 +#define PATCHLEVEL 7 /* The last built version of this shell. */ #define BUILDVERSION 1 /* A version string for use by sccs and the what command. */ -#define SCCSVERSION "@(#)Bash version 1.14.6(1) GNU" +#define SCCSVERSION "@(#)Bash version 1.14.7(1) GNU" |
From: kevin s. <xk...@us...> - 2002-03-11 04:56:14
|
Update of /cvsroot/winbash/winbash In directory usw-pr-cvs1:/tmp/cvs-serv1601 Modified Files: .build version.h Log Message: update build/version Index: .build =================================================================== RCS file: /cvsroot/winbash/winbash/.build,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- .build 11 Mar 2002 04:50:29 -0000 1.8 +++ .build 11 Mar 2002 04:56:11 -0000 1.9 @@ -1 +1 @@ -8 +1 Index: version.h =================================================================== RCS file: /cvsroot/winbash/winbash/version.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- version.h 11 Mar 2002 04:50:29 -0000 1.7 +++ version.h 11 Mar 2002 04:56:11 -0000 1.8 @@ -8,9 +8,9 @@ #define PATCHLEVEL 6 /* The last built version of this shell. */ -#define BUILDVERSION 8 +#define BUILDVERSION 1 /* A version string for use by sccs and the what command. */ -#define SCCSVERSION "@(#)Bash version 1.14.6(8) GNU" +#define SCCSVERSION "@(#)Bash version 1.14.6(1) GNU" |
From: kevin s. <xk...@us...> - 2002-03-11 04:50:33
|
Update of /cvsroot/winbash/winbash/lib/readline In directory usw-pr-cvs1:/tmp/cvs-serv555/lib/readline Modified Files: complete.c history.c signals.c Log Message: applied gnu bash 1.14.6 diffs Index: complete.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/complete.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- complete.c 11 Mar 2002 01:47:04 -0000 1.3 +++ complete.c 11 Mar 2002 04:50:29 -0000 1.4 @@ -491,7 +491,7 @@ } } - if (rl_point == end && found_quote == 0) + if (rl_point == end && quote_char == '\0') { int quoted = 0; /* We didn't find an unclosed quoted substring upon which to do @@ -656,7 +656,16 @@ munge the array, deleting matches as it desires. */ if (rl_ignore_some_completions_function && our_func == (Function *)filename_completion_function) - (void)(*rl_ignore_some_completions_function)(matches); + { + (void)(*rl_ignore_some_completions_function)(matches); + if (matches == 0 || matches[0] == 0) + { + if (matches) + free (matches); + ding (); + return; + } + } /* If we are doing completion on quoted substrings, and any matches contain any of the completer_word_break_characters, then auto- Index: history.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/history.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- history.c 9 Mar 2002 16:05:43 -0000 1.2 +++ history.c 11 Mar 2002 04:50:30 -0000 1.3 @@ -332,6 +332,8 @@ reverse = (direction < 0); /* Take care of trivial cases first. */ + if (string == 0 || *string == '\0') + return (-1); if (!history_length || ((i == history_length) && !reverse)) return (-1); Index: signals.c =================================================================== RCS file: /cvsroot/winbash/winbash/lib/readline/signals.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- signals.c 9 Mar 2002 03:39:13 -0000 1.1.1.1 +++ signals.c 11 Mar 2002 04:50:30 -0000 1.2 @@ -232,12 +232,12 @@ { old_int = (SigHandler *)rl_set_sighandler (SIGINT, rl_signal_handler); if (old_int == (SigHandler *)SIG_IGN) - signal (SIGINT, SIG_IGN); + rl_set_sighandler (SIGINT, SIG_IGN); #ifdef SIGALRM old_alrm = (SigHandler *)rl_set_sighandler (SIGALRM, rl_signal_handler); if (old_alrm == (SigHandler *)SIG_IGN) - signal (SIGALRM, SIG_IGN); + rl_set_sighandler (SIGALRM, SIG_IGN); #endif #if !defined (SHELL) @@ -245,7 +245,7 @@ #if defined (SIGTSTP) old_tstp = (SigHandler *)rl_set_sighandler (SIGTSTP, rl_signal_handler); if (old_tstp == (SigHandler *)SIG_IGN) - signal (SIGTSTP, SIG_IGN); + rl_set_sighandler (SIGTSTP, SIG_IGN); #endif /* SIGTSTP */ #if defined (SIGTTOU) old_ttou = (SigHandler *)rl_set_sighandler (SIGTTOU, rl_signal_handler); @@ -253,8 +253,8 @@ if (old_tstp == (SigHandler *)SIG_IGN) { - signal (SIGTTOU, SIG_IGN); - signal (SIGTTIN, SIG_IGN); + rl_set_sighandler (SIGTTOU, SIG_IGN); + rl_set_sighandler (SIGTTIN, SIG_IGN); } #endif /* SIGTTOU */ |
From: kevin s. <xk...@us...> - 2002-03-11 04:50:33
|
Update of /cvsroot/winbash/winbash/support In directory usw-pr-cvs1:/tmp/cvs-serv555/support Modified Files: mksysdefs Log Message: applied gnu bash 1.14.6 diffs Index: mksysdefs =================================================================== RCS file: /cvsroot/winbash/winbash/support/mksysdefs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mksysdefs 11 Mar 2002 01:47:05 -0000 1.4 +++ mksysdefs 11 Mar 2002 04:50:30 -0000 1.5 @@ -257,6 +257,7 @@ if [ "$SYSDEF" = "" -a -f /bin/uname ]; then case `/bin/uname -X 2>/dev/null | grep '^Release' 2>/dev/null` in *3.2v4.*) SYSDEF=SCOv4 ;; + *3.2v5.*) SYSDEF=SCOv5 ;; *) SYSDEF=SCO ;; esac fi |
From: kevin s. <xk...@us...> - 2002-03-11 04:50:33
|
Update of /cvsroot/winbash/winbash/documentation In directory usw-pr-cvs1:/tmp/cvs-serv555/documentation Modified Files: FAQ bash.1 Log Message: applied gnu bash 1.14.6 diffs Index: FAQ =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/FAQ,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FAQ 11 Mar 2002 02:03:11 -0000 1.1 +++ FAQ 11 Mar 2002 04:50:29 -0000 1.2 @@ -1,3 +1,5 @@ +This is the Bash FAQ, version 1.2, for Bash version 1.14.6. + This document contains a set of frequently-asked questions concerning Bash, the GNU Bourne-Again Shell. Bash is a freely-available command interpreter with advanced features for both interactive use and shell @@ -6,7 +8,7 @@ Another good source of basic information about shells is the collection of FAQ articles periodically posted to comp.unix.shell. -Questions and comments concerning the document should be set to +Questions and comments concerning this document should be set to ch...@po.... Contents: @@ -32,8 +34,8 @@ still invoke the command from within the function? 18) When I have terminal escape sequences in my prompt, why does bash wrap lines at the wrong column? -19) I built bash on Solaris 2. Why do globbing expansions chop off the - first few characters of each filename? +19) I built bash on Solaris 2. Why do globbing expansions and filename + completion chop off the first few characters of each filename? 20) Why doesn't bash treat brace expansions exactly like csh? 21) Why does bash dump core after I interrupt username completion? 22) I'm running SVR4.2. Why is the line erased every time I type `@'? @@ -47,12 +49,14 @@ in arguments to `echo'. Bash doesn't interpret these characters. Why not, and how can I make it understand them? 27) Why doesn't bash have csh variable modifiers? -28) How do I report bugs in bash, and where should I look for fixes and +28) Why does bash report syntax errors when my C News scripts use a + redirection before a subshell command? +29) How do I report bugs in bash, and where should I look for fixes and advice? -29) What kind of bash documentation is there? -30) What's coming in future versions? -31) What's on the bash `wish list'? -32) When will the next release appear? +30) What kind of bash documentation is there? +31) What's coming in future versions? +32) What's on the bash `wish list'? +33) When will the next release appear? 1) What is it? @@ -66,11 +70,15 @@ history, job control, aliases, and prompt expansion. Programming features include additional variable expansions, shell arithmetic, and a number of variables and options to control -shell behavior. +shell behavior. + +Bash was originally written by Brian Fox of the Free Software +Foundation. The current developer and maintainer is Chet Ramey +of Case Western Reserve University. 2) What's the latest version? -The latest version is 1.14.4, first made available on April 21, 1995. +The latest version is 1.14.6, first made available on December 19, 1995. 3) Where can I get it? @@ -78,10 +86,10 @@ master GNU archive site, prep.ai.mit.edu, and its mirrors. The latest version is also available for FTP from slc2.ins.cwru.edu, the maintainer's machine. The following URLs tell how to get -version 1.14.4: +version 1.14.6: -ftp://prep.ai.mit.edu/pub/gnu/bash-1.14.4.tar.gz -ftp://slc2.ins.cwru.edu/pub/dist/bash-1.14.4.tar.gz +ftp://prep.ai.mit.edu/pub/gnu/bash-1.14.6.tar.gz +ftp://slc2.ins.cwru.edu/pub/dist/bash-1.14.6.tar.gz 4) What's the `Posix 1003.2 standard'? @@ -346,7 +354,7 @@ sed -n 's:^declare -[a-z]* \([^ ]*\).*$:\1:p' cd, print, whence function subsitutes in examples/functions/kshenv autoloaded functions examples/functions/autoload is the same as typeset -fu -read var?prompt [ -t 0 ] && echo -n prompt; read var +read var?prompt [ -t 0 ] && echo -n prompt >&2; read var 13) Why is the bash builtin `test' slightly different from /bin/test? @@ -408,7 +416,7 @@ stty pass8 -you may also need +You may also need stty even odd @@ -477,8 +485,8 @@ Use the \[ escape to begin a sequence of non-printing characters, and the \] escape to signal the end of such a sequence. -19) I built bash on Solaris 2. Why do globbing expansions chop off the - first few characters of each filename? +19) I built bash on Solaris 2. Why do globbing expansions and filename + completion chop off the first few characters of each filename? This is the consequence of building bash on SunOS 5 and linking with the libraries in /usr/ucblib, but using the definitions @@ -488,9 +496,14 @@ /usr/include/dirent.h and the struct returned by the version of `readdir' in libucb.a (a 4.3-BSD style `struct direct'). -Make sure you've got /bin ahead of /usr/ucb in your $PATH when -building bash. This will ensure that you use /bin/cc or acc -instead of /usr/ucb/cc and that you link with libc before libucb. +Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH +when building bash. This will ensure that you use /usr/ccs/bin/cc +or acc instead of /usr/ucb/cc and that you link with libc before +libucb. + +If you have installed the Sun C compiler, you may also need to +put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before +/usr/ucb. 20) Why doesn't bash treat brace expansions exactly like csh? @@ -661,7 +674,25 @@ $b:e ${b##*.} xxx -28) How do I report bugs in bash, and where should I look for fixes and +28) Why does bash report syntax errors when my C News scripts use a + redirection before a subshell command? + +The actual command in question is something like + + < file ( command ) + +According to the grammar given in the Posix.2 standard, this construct +is, in fact, a syntax error. Redirections may only precede `simple +commands'. A subshell construct such as the above is one of the shell's +`compound commands'. A redirection may only follow a compound command. + +The file CWRU/sh-redir-hack in the 1.14.6 distribution is an (unofficial) +patch to parse.y that will modify the grammar to support this construct. +Note that if you apply this, you must recompile with -DREDIRECTION_HACK. +This introduces a large number of reduce/reduce conflicts into the shell +grammar. + +29) How do I report bugs in bash, and where should I look for fixes and advice? Use the `bashbug' script to report bugs. It is built and @@ -679,7 +710,7 @@ To reach the bash maintainers directly, send mail to bas...@pr.... -29) What kind of bash documentation is there? +30) What kind of bash documentation is there? First, look in the documentation directory in the bash distribution. It should contain the following files: @@ -701,7 +732,7 @@ published by O'Reilly and Associates. Look for it sometime this year. -30) What's coming in future versions? +31) What's coming in future versions? There will be no new features in future releases of version 1.14. @@ -735,7 +766,7 @@ lots of code now smaller and faster test suite greatly expanded -31) What's on the bash `wish list'? +32) What's on the bash `wish list'? internationalization with a variable expansion to translate a string according to a particular message catalog @@ -748,9 +779,17 @@ Much of this will not be in bash-2.0. -32) When will the next release appear? +33) When will the next release appear? -There will probably be a 1.14.5 release to coincide with the next GNU -source CD. That will be the last release for version 1.14. +Version 1.14.6 will probably be the last release for version 1.14. -The next version will appear sometime in 1995. Never make predictions. +The next version will appear sometime in 1996. Never make predictions. + + +This document is copyright Chester Ramey, 1995. + +Permission is hereby granted, without written agreement and +without license or royalty fees, to use, copy, and distribute +this document for any purpose, provided that the above copyright +notice appears in all copies of this document and that the +contents of this document remain unaltered. Index: bash.1 =================================================================== RCS file: /cvsroot/winbash/winbash/documentation/bash.1,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- bash.1 11 Mar 2002 01:47:04 -0000 1.4 +++ bash.1 11 Mar 2002 04:50:29 -0000 1.5 @@ -2881,7 +2881,7 @@ yank\-last\-arg (M\-.\^, M\-_\^) Insert the last argument to the previous command (the last word on the previous line). With an argument, -behave exactly like @code{yank-nth-arg}. +behave exactly like \fByank-nth-arg\fP. .TP .B shell\-expand\-line (M\-C\-e) Expand the line the way the shell does when it reads it. This |
From: kevin s. <xk...@us...> - 2002-03-11 04:50:32
|
Update of /cvsroot/winbash/winbash In directory usw-pr-cvs1:/tmp/cvs-serv555 Modified Files: .build .patchlevel bashline.c general.c machines.h parse.y shell.h subst.c trap.c version.h Log Message: applied gnu bash 1.14.6 diffs Index: .build =================================================================== RCS file: /cvsroot/winbash/winbash/.build,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- .build 11 Mar 2002 01:47:03 -0000 1.7 +++ .build 11 Mar 2002 04:50:29 -0000 1.8 @@ -1 +1 @@ -5 +8 Index: .patchlevel =================================================================== RCS file: /cvsroot/winbash/winbash/.patchlevel,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- .patchlevel 11 Mar 2002 01:47:04 -0000 1.4 +++ .patchlevel 11 Mar 2002 04:50:29 -0000 1.5 @@ -1 +1 @@ -5 +6 Index: bashline.c =================================================================== RCS file: /cvsroot/winbash/winbash/bashline.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- bashline.c 9 Mar 2002 16:05:41 -0000 1.2 +++ bashline.c 11 Mar 2002 04:50:29 -0000 1.3 @@ -792,6 +792,7 @@ command = savestring (VI_EDIT_COMMAND); } parse_and_execute (command, "v", -1); + rl_line_buffer[0] = '\0'; /* erase pre-edited command */ } #endif /* VI_MODE */ @@ -1658,35 +1659,64 @@ char **names; Function *name_func; { - char **p; - int idx; + char **newnames; + int idx, nidx; - for (p = names + 1, idx = -1; *p; p++) + /* If there is only one completion, see if it is acceptable. If it is + not, free it up. In any case, short-circuit and return. This is a + special case because names[0] is not the prefix of the list of names + if there is only one completion; it is the completion itself. */ + if (names[1] == (char *)0) { - if ((*name_func) (*p)) - { - if (idx == -1) /* First match found. */ - idx = p - names; - else - return; /* Too many matches. */ - } + if ((*name_func) (names[0]) == 0) + { + free (names[0]); + names[0] = (char *)NULL; + } + return; } - - /* If none are acceptable then let the completer handle it. */ - if (idx == -1) - return; - /* Delete all non-matching elements. */ - free (names[0]); - for (p = names + 1; *p; p++) + /* Allocate space for array to hold list of pointers to matching + filenames. The pointers are copied back to NAMES when done. */ + for (nidx = 1; names[nidx]; nidx++) + ; + newnames = (char **)xmalloc ((nidx + 1) * (sizeof (char *))); + + newnames[0] = names[0]; + for (idx = nidx = 1; names[idx]; idx++) { - if (idx == (p - names)) - names[0] = *p; - else - free (*p); + if ((*name_func) (names[idx])) + newnames[nidx++] = names[idx]; + else + free (names[idx]); + } - *p = NULL; + newnames[nidx] = (char *)NULL; + + /* If none are acceptable then let the completer handle it. */ + if (nidx == 1) + { + free (names[0]); + names[0] = (char *)NULL; + free (newnames); + return; + } + + /* If only one is acceptable, copy it to names[0] and return. */ + if (nidx == 2) + { + free (names[0]); + names[0] = newnames[1]; + names[1] = (char *)NULL; + free (newnames); + return; } + + /* Copy the acceptable names back to NAMES, set the new array end, + and return. */ + for (nidx = 1; newnames[nidx]; nidx++) + names[nidx] = newnames[nidx]; + names[nidx] = (char *)NULL; } static void Index: general.c =================================================================== RCS file: /cvsroot/winbash/winbash/general.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- general.c 11 Mar 2002 01:47:04 -0000 1.4 +++ general.c 11 Mar 2002 04:50:29 -0000 1.5 @@ -1081,9 +1081,9 @@ * */ -#if !defined (USG) && !defined (HPUX) +#if !defined (USG) && !defined (HPUX) && !defined (HAVE_GETDTABLESIZE) # define HAVE_GETDTABLESIZE -#endif /* !USG && !HPUX */ +#endif /* !USG && !HPUX && !HAVE_GETDTABLESIZE */ #if defined (hppa) && (defined (hpux_8) || defined (hpux_9)) # undef HAVE_GETDTABLESIZE @@ -1180,6 +1180,9 @@ } #if defined (NO_READ_RESTART_ON_SIGNAL) +static char localbuf[128]; +static int local_index = 0, local_bufused = 0; + /* Posix and USG systems do not guarantee to restart read () if it is interrupted by a signal. We do the read ourselves, and restart it if it returns EINTR. */ @@ -1187,9 +1190,6 @@ getc_with_restart (stream) FILE *stream; { - static char localbuf[128]; - static int local_index = 0, local_bufused = 0; - /* Try local buffering to reduce the number of read(2) calls. */ if (local_index == local_bufused || local_bufused == 0) { @@ -1208,6 +1208,17 @@ } return (localbuf[local_index++]); } + +int +ungetc_with_restart (c, fp) + int c; + FILE *fp; +{ + if (local_index == 0 || local_bufused == 0 || c == EOF) + return EOF; + return (localbuf[--local_index] = c); +} + #endif /* NO_READ_RESTART_ON_SIGNAL */ #if defined (USG) || defined (AIX) || (defined (_POSIX_VERSION) && defined (Ultrix)) Index: machines.h =================================================================== RCS file: /cvsroot/winbash/winbash/machines.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- machines.h 11 Mar 2002 01:47:04 -0000 1.4 +++ machines.h 11 Mar 2002 04:50:29 -0000 1.5 @@ -96,8 +96,24 @@ # define VOID_SIGHANDLER # define HAVE_DIRENT # define HAVE_STRCASECMP +# undef USE_GNU_MALLOC #endif /* sparc && __NetBSD__ */ +/* BSDI BSD/OS running on a sparc. */ +#if defined (sparc) && defined (__bsdi__) +# define M_MACHINE "sun4" +# define M_OS "BSD_OS" +# define SYSDEP_CFLAGS -DOPENDIR_NOT_ROBUST -DRLIMTYPE=quad_t +# define HAVE_SYS_SIGLIST +# define HAVE_SETLINEBUF +# define HAVE_GETGROUPS +# define HAVE_VFPRINTF +# define HAVE_STRERROR +# define VOID_SIGHANDLER +# define HAVE_DIRENT +# define HAVE_STRCASECMP +#endif /* sparc && __bsdi__ */ + #if defined (sun) && !defined (M_MACHINE) /* We aren't currently using GNU Malloc on Suns because of a bug in Sun's YP which bites us when Sun free ()'s an already free ()'ed address. @@ -195,6 +211,26 @@ #endif /* __alpha || alpha */ /* ************************ */ +/* */ +/* NetBSD/pmax (DEC mips) */ +/* */ +/* ************************ */ +#if defined(mips) && defined(__NetBSD__) +# define M_MACHINE "mips" +# define M_OS "NetBSD" +# define SYSDEP_CFLAGS -DOPENDIR_NOT_ROBUST -DINT_GROUPS_ARRAY \ + -DRLIMTYPE=quad_t +# define HAVE_SYS_SIGLIST +# define HAVE_SETLINEBUF +# define HAVE_GETGROUPS +# define HAVE_VFPRINTF +# define HAVE_STRERROR +# define VOID_SIGHANDLER +# define HAVE_DIRENT +# define HAVE_STRCASECMP +#endif /* mips && __NetBSD__ */ + +/* ************************ */ /* */ /* Ultrix */ /* */ @@ -308,6 +344,7 @@ -DHAVE_SOCKETS # endif /* !Irix5 */ # define SYSDEP_CFLAGS SGI_CFLAGS MACHINE_CFLAGS ANSIC +# define SYSDEP_LDFLAGS MACHINE_CFLAGS #endif /* sgi */ /* ************************ */ @@ -491,6 +528,7 @@ # if !defined (HAVE_GCC) # undef MACHINE_CFLAGS # define MACHINE_CFLAGS -Wf,-XNl3072 -systype bsd43 +# define SYSDEP_LDFLAGS -systype bsd43 # endif /* !HAVE_GCC */ # define SYSDEP_CFLAGS MACHINE_CFLAGS MIPS_CFLAGS # define HAVE_SYS_SIGLIST @@ -731,11 +769,11 @@ # define M_MACHINE "i386" # define M_OS "SCO" # define SCO_CFLAGS -DUSG -DUSGr3 -DPGRP_PIPE -# if defined (SCOv4) +# if defined (SCOv4) || defined (SCOv5) # define SYSDEP_CFLAGS SCO_CFLAGS -DWAITPID_BROKEN -# else /* !SCOv4 */ +# else /* !SCOv4 && !SCOv5 */ # define SYSDEP_CFLAGS SCO_CFLAGS -DOPENDIR_NOT_ROBUST -DMUST_UNBLOCK_CHILD -# endif /* !SCOv4 */ +# endif /* !SCOv4 && !SCOv5 */ # define HAVE_VFPRINTF # define VOID_SIGHANDLER # define HAVE_GETGROUPS @@ -968,6 +1006,30 @@ # undef HAVE_ALLOCA #endif /* alliant */ +/* ********************* */ +/* */ +/* Linux/m68k */ +/* */ +/* ********************* */ +#if defined (mc68000) && (defined (__linux__) || defined (linux)) +# define M_MACHINE "m68k" +# define M_OS "Linux" +# define SYSDEP_CFLAGS -DHAVE_BCOPY -DHAVE_GETPW_DECLS -DHAVE_GETHOSTNAME +# define REQUIRED_LIBRARIES +# define HAVE_GETGROUPS +# define HAVE_STRERROR +# define VOID_SIGHANDLER +# define HAVE_SYS_SIGLIST +# define HAVE_VFPRINTF +# define HAVE_VARARGS_H +# if defined (__GNUC__) +# define HAVE_FIXED_INCLUDES +# endif /* __GNUC__ */ +# undef USE_GNU_MALLOC +# undef HAVE_SETLINEBUF +# define HAVE_STRCASECMP +#endif /* mc68000 && __linux__ */ + /* **************************************************************** */ /* */ /* Motorola Delta series running System V R3V6/7 */ @@ -1173,6 +1235,20 @@ # undef USE_GNU_MALLOC # undef HAVE_RESOURCE # define HPUX_CFLAGS -DNO_SBRK_DECL -DHAVE_SOCKETS -DHAVE_GETHOSTNAME HPUX_ANSI +# endif /* HPUX_9 */ + +# if defined (HPUX_10) +# define M_OS "hpux_10" +# if !defined (__GNUC__) +# undef HAVE_ALLOCA +# define HPUX_ANSI +O3 -Ae +# else +# define HPUX_ANSI +# endif +# undef HAVE_GETWD +# undef USE_GNU_MALLOC +# undef HAVE_RESOURCE +# define HPUX_CFLAGS -DNO_SBRK_DECL -DHAVE_SOCKETS -DHAVE_GETHOSTNAME -DBSD_GETPGRP HPUX_ANSI # endif /* HPUX_9 */ # endif /* !HPUX_USG */ Index: parse.y =================================================================== RCS file: /cvsroot/winbash/winbash/parse.y,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- parse.y 10 Mar 2002 23:25:31 -0000 1.4 +++ parse.y 11 Mar 2002 04:50:29 -0000 1.5 @@ -964,7 +964,11 @@ yy_stream_unget (c) int c; { +#if defined (NO_READ_RESTART_ON_SIGNAL) + return (ungetc_with_restart (c, bash_input.location.file)); +#else return (ungetc (c, bash_input.location.file)); +#endif } void @@ -1731,6 +1735,9 @@ \ if (word_token_alist[i].token == '{') \ open_brace_awaiting_satisfaction++; \ +\ + if (word_token_alist[i].token == '}' && open_brace_awaiting_satisfaction) \ + open_brace_awaiting_satisfaction--; \ \ return (word_token_alist[i].token); \ } \ Index: shell.h =================================================================== RCS file: /cvsroot/winbash/winbash/shell.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- shell.h 10 Mar 2002 21:45:13 -0000 1.2 +++ shell.h 11 Mar 2002 04:50:29 -0000 1.3 @@ -93,7 +93,7 @@ #define FD_BITMAP_SIZE 32 #define CTLESC '\001' -#define CTLNUL '\002' +#define CTLNUL '\177' /* Information about the current user. */ struct user_info { Index: subst.c =================================================================== RCS file: /cvsroot/winbash/winbash/subst.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- subst.c 11 Mar 2002 01:47:04 -0000 1.5 +++ subst.c 11 Mar 2002 04:50:29 -0000 1.6 @@ -199,7 +199,12 @@ char *temp; if (charlist[0] == '\'' && !charlist[1]) - return (string_extract_single_quoted (string, sindex)); + { + temp = string_extract_single_quoted (string, sindex); + i = *sindex - 1; + *sindex = i; + return (temp); + } for (i = *sindex; (c = string[i]); i++) { @@ -732,33 +737,35 @@ for (i = pass_next = quoted = 0; i <= eindex; i++) { if (pass_next) - { - pass_next = 0; - if (i >= eindex) /* XXX was if (i >= eindex - 1) */ - return 1; - continue; - } + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + return 1; + continue; + } else if (string[i] == '\'') - { - i++; - temp = string_extract_single_quoted (string, &i); - free (temp); - if (i > eindex) - return 1; - } + { + i++; + temp = string_extract_single_quoted (string, &i); + free (temp); + if (i > eindex) + return 1; + i--; + } else if (string[i] == '"') - { - i++; - temp = string_extract_double_quoted (string, &i); - free (temp); - if (i > eindex) - return 1; - } + { + i++; + temp = string_extract_double_quoted (string, &i); + free (temp); + if (i > eindex) + return 1; + i--; + } else if (string[i] == '\\') - { - pass_next = 1; - continue; - } + { + pass_next = 1; + continue; + } } return (0); } @@ -939,8 +946,35 @@ quoted null characters in the middle or at the ends of strings because of how expand_word_internal works. remove_quoted_nulls () simply turns STRING into an empty string iff it only consists of a quoted null. */ +/* #define remove_quoted_nulls(string) \ do { if (QUOTED_NULL (string)) string[0] ='\0'; } while (0) +*/ +static void +remove_quoted_nulls (string) + char *string; +{ + char *nstr, *s, *p; + + nstr = savestring (string); + nstr[0] = '\0'; + for (p = nstr, s = string; *s; s++) + { + if (*s == CTLESC) + { + *p++ = *s++; /* CTLESC */ + if (*s == 0) + break; + *p++ = *s; /* quoted char */ + continue; + } + if (*s == CTLNUL) + continue; + *p++ = *s; + } + *p = '\0'; + strcpy (string, nstr); +} /* Perform quoted null character removal on each element of LIST. This modifies LIST. */ @@ -1845,7 +1879,7 @@ char *tname; tname = mktemp (savestring ("/tmp/sh-np-XXXXXX")); - if (mkfifo (tname, 0666) < 0) + if (mkfifo (tname, 0600) < 0) { free (tname); return ((char *) NULL); @@ -1885,19 +1919,17 @@ { if (!dev_fd_list || fd >= totfds) { - int zero; + int ofds; + ofds = totfds; totfds = getdtablesize (); if (totfds < 0 || totfds > 256) totfds = 256; if (fd > totfds) totfds = fd + 2; - zero = dev_fd_list == (char *) NULL; dev_fd_list = xrealloc (dev_fd_list, totfds); - if (zero) - bzero (dev_fd_list, totfds); - /* XXX - should zero out new portion of list here - XXX */ + bzero (dev_fd_list + ofds, totfds - ofds); } dev_fd_list[fd] = 1; @@ -2533,6 +2565,12 @@ { temp = string_list (l); dispose_words (l); + } + else if (lquote) + { + temp = xmalloc (2); + temp[0] = CTLNUL; + temp[1] = '\0'; } else temp = (char *)NULL; Index: trap.c =================================================================== RCS file: /cvsroot/winbash/winbash/trap.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- trap.c 10 Mar 2002 23:25:31 -0000 1.4 +++ trap.c 11 Mar 2002 04:50:29 -0000 1.5 @@ -469,6 +469,10 @@ int run_exit_trap () { + int old_exit_value; + + old_exit_value = last_command_exit_value; + /* Run the trap only if signal 0 is trapped and not ignored. */ if ((sigmodes[0] & SIG_TRAPPED) && (trap_list[0] != (char *)IGNORE_SIG) && @@ -484,8 +488,13 @@ if (code == 0) parse_and_execute (trap_command, "trap", 0); + else if (code == EXITPROG) + return (last_command_exit_value); + else + return (old_exit_value); } - return (last_command_exit_value); + + return (old_exit_value); } /* Set the handler signal SIG to the original and free any trap Index: version.h =================================================================== RCS file: /cvsroot/winbash/winbash/version.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- version.h 11 Mar 2002 01:47:04 -0000 1.6 +++ version.h 11 Mar 2002 04:50:29 -0000 1.7 @@ -5,12 +5,12 @@ #define DISTVERSION "1.14" /* The patch level of this version of the shell. */ -#define PATCHLEVEL 5 +#define PATCHLEVEL 6 /* The last built version of this shell. */ -#define BUILDVERSION 5 +#define BUILDVERSION 8 /* A version string for use by sccs and the what command. */ -#define SCCSVERSION "@(#)Bash version 1.14.5(5) GNU" +#define SCCSVERSION "@(#)Bash version 1.14.6(8) GNU" |
From: kevin s. <xk...@us...> - 2002-03-11 04:50:32
|
Update of /cvsroot/winbash/winbash/builtins In directory usw-pr-cvs1:/tmp/cvs-serv555/builtins Modified Files: fc.def getopt.c getopts.def Log Message: applied gnu bash 1.14.6 diffs Index: fc.def =================================================================== RCS file: /cvsroot/winbash/winbash/builtins/fc.def,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- fc.def 11 Mar 2002 01:47:04 -0000 1.4 +++ fc.def 11 Mar 2002 04:50:29 -0000 1.5 @@ -267,6 +267,8 @@ /* This is the second form of the command (the list-or-edit-and-rerun form). */ hlist = history_list (); + if (hlist == 0) + return (EXECUTION_SUCCESS); for (i = 0; hlist[i]; i++); /* With the Bash implementation of history, the current command line Index: getopt.c =================================================================== RCS file: /cvsroot/winbash/winbash/builtins/getopt.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- getopt.c 11 Mar 2002 01:47:04 -0000 1.3 +++ getopt.c 11 Mar 2002 04:50:29 -0000 1.4 @@ -105,8 +105,8 @@ ARGV-element, is returned in `sh_optarg'. */ /* 1003.2 specifies the format of this message. */ -#define BADOPT(c) fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c) -#define NEEDARG(c) fprintf (stderr, "%s: option requires an argument -- %c\n", argv[0], c) +#define BADOPT(x) fprintf (stderr, "%s: illegal option -- %c\n", argv[0], x) +#define NEEDARG(x) fprintf (stderr, "%s: option requires an argument -- %c\n", argv[0], x) int sh_getopt (argc, argv, optstring) Index: getopts.def =================================================================== RCS file: /cvsroot/winbash/winbash/builtins/getopts.def,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- getopts.def 11 Mar 2002 01:47:04 -0000 1.4 +++ getopts.def 11 Mar 2002 04:50:29 -0000 1.5 @@ -165,7 +165,7 @@ { register int i; - for (i = 0; dollar_vars[i]; i++); + for (i = 0; i < 10 && dollar_vars[i]; i++); ret = sh_getopt (i, dollar_vars, optstr); } else @@ -174,10 +174,10 @@ register WORD_LIST *words; char **v; - for (i = 0; dollar_vars[i]; i++); + for (i = 0; i < 10 && dollar_vars[i]; i++); for (words = rest_of_args; words; words = words->next, i++); v = (char **)xmalloc ((i + 1) * sizeof (char *)); - for (i = 0; dollar_vars[i]; i++) + for (i = 0; i < 10 && dollar_vars[i]; i++) v[i] = dollar_vars[i]; for (words = rest_of_args; words; words = words->next, i++) v[i] = words->word->word; |
From: Enrico B. <enr...@us...> - 2002-03-11 02:03:13
|
Update of /cvsroot/winbash/winbash/documentation In directory usw-pr-cvs1:/tmp/cvs-serv27612/documentation Added Files: FAQ Log Message: moved FAQ to documentation subdir --- NEW FILE: FAQ --- This document contains a set of frequently-asked questions concerning Bash, the GNU Bourne-Again Shell. Bash is a freely-available command interpreter with advanced features for both interactive use and shell programming. Another good source of basic information about shells is the collection of FAQ articles periodically posted to comp.unix.shell. Questions and comments concerning the document should be set to ch...@po.... Contents: 1) What is it? 2) What's the latest version? 3) Where can I get it? 4) What's the `Posix 1003.2 standard'? 5) On what machines will bash run? 6) How does bash differ from sh, the Bourne shell? 7) How does bash differ from the Korn shell? 8) What is the bash `posix mode'? 9) How can I build bash with gcc? 10) Why does bash run a different version of `command' than `which command' says it will? 11) How can I make my csh aliases work when I convert to bash? 12) Now that I've converted from ksh to bash, are there equivalents to ksh features like autoloaded functions and the `whence' command? 13) Why is the bash builtin `test' slightly different from /bin/test? 14) Why does bash sometimes say `Broken pipe'? 15) How can I get bash to read and display eight-bit characters? 16) Why can't I use command line editing in my `cmdtool'? 17) How do I write a function `x' to replace builtin command `x', but still invoke the command from within the function? 18) When I have terminal escape sequences in my prompt, why does bash wrap lines at the wrong column? 19) I built bash on Solaris 2. Why do globbing expansions chop off the first few characters of each filename? 20) Why doesn't bash treat brace expansions exactly like csh? 21) Why does bash dump core after I interrupt username completion? 22) I'm running SVR4.2. Why is the line erased every time I type `@'? 23) How can I find the value of a shell variable whose name is the value of another shell variable? 24) If I pipe the output of a command into `read variable', why doesn't the output show up in $variable when the read command finishes? 25) I just changed my shell to bash, and now I can't FTP into my machine. Why not? 26) I have a bunch of shell scripts that use backslash-escaped characters in arguments to `echo'. Bash doesn't interpret these characters. Why not, and how can I make it understand them? 27) Why doesn't bash have csh variable modifiers? 28) How do I report bugs in bash, and where should I look for fixes and advice? 29) What kind of bash documentation is there? 30) What's coming in future versions? 31) What's on the bash `wish list'? 32) When will the next release appear? 1) What is it? Bash is a Unix command interpreter (shell). It is an implementation of the Posix 1003.2 shell standard, and resembles the Korn and System V shells. Bash contains a number of enhancements over those shells, both for interactive use and shell programming. Features geared toward interactive use include command line editing, command history, job control, aliases, and prompt expansion. Programming features include additional variable expansions, shell arithmetic, and a number of variables and options to control shell behavior. 2) What's the latest version? The latest version is 1.14.4, first made available on April 21, 1995. 3) Where can I get it? Bash is the GNU project's shell, and so is available from the master GNU archive site, prep.ai.mit.edu, and its mirrors. The latest version is also available for FTP from slc2.ins.cwru.edu, the maintainer's machine. The following URLs tell how to get version 1.14.4: ftp://prep.ai.mit.edu/pub/gnu/bash-1.14.4.tar.gz ftp://slc2.ins.cwru.edu/pub/dist/bash-1.14.4.tar.gz 4) What's the `Posix 1003.2 standard'? POSIX is a name originally coined by Richard Stallman for a family of open system standards based on UNIX. There are a number of aspects of UNIX under consideration for standardization, from the basic system services at the system call and C library level to applications and tools to system administration and management. Each area of standardization is assigned to a working group in the 1003 series. The POSIX Shell and Utilities standard has been developed by IEEE Working Group 1003.2 (POSIX.2). It concentrates on the command interpreter interface and utility programs commonly executed from the command line or by other programs. An initial version of the standard has been approved and published by the IEEE, and work is currently underway to update it. Bash is concerned with the aspects of the shell's behavior defined by POSIX.2. The shell command language has of course been standardized, including the basic flow control and program execution constructs, I/O redirection and pipelining, argument handling, variable expansion, and quoting. The `special' builtins, which must be implemented as part of the shell to provide the desired functionality, are specified as being part of the shell; examples of these are `eval' and `export'. Other utilities appear in the sections of POSIX.2 not devoted to the shell which are commonly (and in some cases must be) implemented as builtin commands, such as `read' and `test'. POSIX.2 also specifies aspects of the shell's interactive behavior as part of the UPE, including job control and command line editing. Only vi-style line editing commands have been standardized; emacs editing commands were left out due to objections. 5) On what machines will bash run? Bash has been ported to nearly every version of UNIX. All you should have to do to build it on a machine for which a port exists is to type `make'. The build process will attempt to discover the version of UNIX you have and tailor itself accordingly, using a combination of saved definitions in the file `machines.h' and a file `sysdefs.h' created by inspecting the environment for various things. More information appears in the file `INSTALL' in the distribution. 6) How does bash differ from sh, the Bourne shell? This is a non-comprehensive list of features that differentiate bash from the SVR4 shell. The bash manual page explains these completely. Things bash has that sh does not: long invocation options `!' reserved word to invert pipeline return value the select compound command the $(...) form of command substitution the ${#param} parameter value length operator expansions to perform substring removal (${p%[%]w}, ${p#[#]w}) variables: BASH, BASH_VERSION, UID, EUID, REPLY, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS, LINENO, HISTCMD, HOSTTYPE, OSTYPE, ENV, MAIL_WARNING, PS3, PS4, HISTSIZE, HISTFILE, HISTFILESIZE, PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC, HISTCONTROL, command_oriented_history, allow_null_glob_expansion, glob_dot_filenames, histchars, nolinks, auto_resume, HOSTFILE, noclobber, TMOUT, no_exit_on_failed_exec, cdable_vars redirections: <>, &>, >| prompt string special char translation and variable expansion auto-export of modified values of variables in initial environment command search finds functions before builtins bash return builtin will exit a file sourced with `.' builtins: cd -, exec -, echo -e/-E, export -n/-f/-p/name=value, pwd -P, read -r, readonly -f, trap -l, ulimit -n/-p/-u, set -b/-m/-o option/-p/-l/-d/-C/-H/-P, unset -f/-v, umask -S, type -all/-path/-type, suspend -f, kill -s bash reads ~/.bashrc for interactive shells, $ENV for non-interactive bash restricted shell mode is more extensive bash allows functions and variables with the same name brace expansion tilde expansion arithmetic expansion and `let' builtin process substitution aliases and alias/unalias builtins local variables in functions and `local' builtin readline and command-line editing history and history/fc builtins csh-like history expansion other new bash builtins: bind, command, builtin, declare/typeset, dirs, enable, fc, help, history, logout, popd, pushd exported functions filename generation when using output redirection (command >a*) Things sh has that bash does not: uses variable SHACCT to do shell accounting includes `stop' builtin (bash can use alias stop='kill -s STOP') `newgrp' builtin turns on job control if called as `jsh' ulimit attempts to set both soft & hard limits if -S/-H not given New things in the SVR4.2 sh: internationalization: $LANG, $LC_CTYPE, $LC_MESSAGES, setlocale, etc. $TIMEOUT (like bash $TMOUT) new builtins: mldmode, priv `read' builtin has -r cannot trap SIGALRM or SIGCHLD kill -s is present Implementation differences: redirection to/from compound commands causes sh to create a subshell bash does not allow unbalanced quotes; sh silently inserts them at EOF bash does not mess with signal 11 sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100 bash splits only the results of expansions on IFS sh does not allow MAILCHECK to be unset (?) 7) How does bash differ from the Korn shell? Things bash has or uses that ksh does not: long invocation options `!' reserved word posix mode and posix conformance command hashing tilde expansion for assignment statements that look like $PATH process substitution with named pipes if /dev/fd is not available variables: BASH, BASH_VERSION, UID, EUID, SHLVL, HISTCMD, HOSTTYPE, OSTYPE, MAIL_WARNING, HISTFILESIZE, OPTERR, PROMPT_COMMAND, IGNOREEOF, FIGNORE, INPUTRC, HISTCONTROL, notify, command_oriented_history, glob_dot_filenames, allow_null_glob_expansion, histchars, nolinks, HOSTFILE, noclobber, auto_resume, no_exit_on_failed_exec, cdable_vars prompt expansion with backslash escapes and command substitution redirection: &> (stdout and stderr) more extensive and extensible editing and completion builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable, exec -, fc -s, export -n/-f/-p, hash, help, history, jobs -x, kill -s, local, logout, popd, pushd, readonly -n/-f/-p, set -o braceexpand/-o histexpand/ -o interactive-comments/-o notify/-o physical/-o posix/ -l/-d/-C/-b/-H/-P, suspend, trap -l, type, ulimit -u, umask -S $[...] synonym for $((...)) `!' csh-style history expansion Things ksh has or uses that bash does not: new version of test: [[...]] ((...)) equivalent to let "..." time keyword to let pipelines be timed tracked aliases $(<file) one-dimensional arrays and appropriate expansions variables: ERRNO, FPATH, COLUMNS, LINES, EDITOR, VISUAL extended pattern matching with egrep-style pattern lists co-processes (|&, >&p, <&p) weirdly-scoped functions typeset +f to list all function names without definitions text of command history kept in a file, not memory builtins: alias -x, cd old new, fc -e -, newgrp, print, read -p/-s/u/var?prompt, set -A/-o gmacs/-o keyword/ -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s, typeset -H/-L/-R/-A/-ft/-fu/-fx/-l/-u/-t, whence Implementation differences: ksh runs last command of a pipeline in parent shell context ksh ulimit sets hard and soft limits by default bash has brace expansion by default bash has fixed startup file for all interactive shells; ksh reads $ENV bash has exported functions bash command search finds functions before builtins 8) What is the bash `posix mode'? Although bash is an implementation of the Posix.2 shell specification, there are areas where the bash default behavior differs from that spec. The bash `posix mode' changes the bash behavior in these areas so that it obeys the spec more closely. Posix mode is entered by starting bash with the -posix option or executing `set -o posix' after bash is running. The specific aspects of bash which change when posix mode is active are listed in the file CWRU/POSIX.NOTES in the bash distribution. 9) How can I build bash with gcc? Type make CC=gcc CPPNAME='$(CC) -E' 10) Why does bash run a different version of `command' than `which command' says it will? `which' is actually a csh script that assumes you're running csh. It reads the csh startup files from your home directory and uses those to determine which `command' will be invoked. Since bash doesn't use any of those startup files, there's a good chance that your bash environment differs from your csh environment. 11) How can I make my csh aliases work when I convert to bash? Bash uses a different syntax to support aliases than csh does. The details can be found in the documentation. We have provided a shell script which does most of the work of conversion for you; this script can be found in ./examples/alias-conv.sh. Here is how you use it: Start csh in the normal way for you. (e.g., `csh') Pipe the output of `alias' through `alias-conv.sh', saving the results into `bash_aliases': alias | alias-conv.sh >bash_aliases Edit `bash_aliases', carefully reading through any created functions. You will need to change the names of csh specific variables (like $cwd) to the bash equivalents (like $PWD). You will also need to remove recursive references to commands which are defined as functions. For example, the csh alias: alias cd 'cd \!*;echo $cwd' is converted to the bash function: cd () { cd $*; echo $cwd } This function contains a self-pointing reference to `cd', which should be changed to use the `builtin' version. It also uses the csh variable `$cwd' which has an equivalent in bash. Precede the recursive reference with the word `builtin', and change the name of the variable: cd () { builtin cd $*; echo $PWD; } Merge the edited file into your ~/.bashrc. 12) Now that I've converted from ksh to bash, are there equivalents to ksh features like autoloaded functions and the `whence' command? There are features in ksh-88 that do not have direct bash equivalents. Most, however, can be emulated with very little trouble. ksh-88 feature Bash equivalent -------------- --------------- [[...]] can usually use [...]; minor differences compiled-in aliases set up aliases in .bashrc; some ksh aliases are bash builtins (hash, history, type) $(<file) $(cat file) arrays no good subsitute yet ((...)) let "..." time use external command; GNU time is particularly useful use time bash -c '...' for complicated constructs extended patterns no good substitute coprocesses named pipe pairs (one for read, one for write) typeset +f declare -f | sed -n 's:^declare -[a-z]* \([^ ]*\).*$:\1:p' cd, print, whence function subsitutes in examples/functions/kshenv autoloaded functions examples/functions/autoload is the same as typeset -fu read var?prompt [ -t 0 ] && echo -n prompt; read var 13) Why is the bash builtin `test' slightly different from /bin/test? The specific example used here is [ ! x -o x ], which is false. Bash's builtin `test' implements the Posix.2 spec, which can be summarized as follows (the wording is due to David Korn): Here is the set of rules for processing test arguments. 0 Args: False 1 Arg: True iff argument is not null. 2 Args: If first arg is !, True iff second argument is null. If first argument is unary, then true if unary test is true Otherwise error. 3 Args: If second argument is a binary operator, do binary test of $1 $3 If first argument is !, negate two argument test of $2 $3 Otherwise error. 4 Args: If first argument is !, negate three argument test of $2 $3 $4. Otherwise unspecified 5 or more Args: unspecified. (Historical shells would use their current algorithm). The operators -a and -o are considered binary operators for the purpose of the 3 Arg case. As you can see, the test becomes (not (x or x)), which is false. 14) Why does bash sometimes say `Broken pipe'? If a sequence of commands appear in a pipeline, and one of the reading commands finishes before the writer has finished, the writer receives a SIGPIPE signal. Many other shells special-case SIGPIPE as an exit status in the pipeline and do not report it. For example, in: ps -aux | head `head' can finish before `ps' writes all of its output, and ps will try to write on a pipe without a reader. In that case, bash will print `Broken pipe' to stderr when ps is killed by a SIGPIPE. 15) How can I get bash to read and display eight-bit characters? This is a process requiring several steps. First, you must ensure that the `physical' data path is a full eight bits. For xterms, for example, the `vt100' resources `eightBitInput' and `eightBitOutput' should be set to `true'. Once you have set up an eight-bit path, you must tell the kernel and tty driver to leave the eigth bit of characters alone when processing keyboard input. Use `stty' to do this: stty cs8 -istrip -parenb For old BSD-style systems, you can use stty pass8 you may also need stty even odd Finally, you need to tell readline that you will be inputting and displaying eight-bit characters. You use readline variables to do this. These variables can be set in your .inputrc or using the bash `bind' builtin. Here's an example using `bind': bash$ bind 'set convert-meta off' bash$ bind 'set meta-flag on' bash$ bind 'set output-meta on' The `set' commands between the single quotes may also be placed in ~/.inputrc. 16) Why can't I use command line editing in my `cmdtool'? The problem is `cmdtool' and bash fighting over the input. When scrolling is enabled in a cmdtool window, cmdtool puts the tty in `raw mode' to permit command-line editing using the mouse for applications that cannot do it themselves. As a result, bash and cmdtool each try to read keyboard input immediately, with neither getting enough of it to be useful. This mode also causes cmdtool to not implement many of the terminal functions and control sequences appearing in the `sun-cmd' termcap entry. For a more complete explanation, see that file examples/suncmd.termcap in the bash distribution. `xterm' is a better choice, and gets along with bash much more smoothly. 17) How do I write a function `x' to replace builtin command `x', but still invoke the command from within the function? This is what the `command' and `builtin' builtins are for. The `command' builtin executes the command supplied as its first argument, skipping over any function defined with that name. The `builtin' builtin executes the builtin command given as its first argument directly. For example, to write a function to replace `cd' that writes the hostname and current directory to an xterm title bar, use something like the following: cd() { builtin cd "$@" && xtitle $HOST: $PWD } This could also be written using `command' instead of `builtin'; the version above is marginally more efficient. 18) When I have terminal escape sequences in my prompt, why does bash wrap lines at the wrong column? Bash does not know that the terminal escape sequences do not take up space on the screen. The redisplay code assumes, unless told otherwise, that each character in the prompt is a `printable' character that takes up one character position on the screen. You can use the bash prompt expansion facility (see the PROMPTING section in the manual page) to tell readline that sequences of characters in the prompt strings take up no screen space. Use the \[ escape to begin a sequence of non-printing characters, and the \] escape to signal the end of such a sequence. 19) I built bash on Solaris 2. Why do globbing expansions chop off the first few characters of each filename? This is the consequence of building bash on SunOS 5 and linking with the libraries in /usr/ucblib, but using the definitions and strutures from files in /usr/include. The actual conflict is between the dirent structure in /usr/include/dirent.h and the struct returned by the version of `readdir' in libucb.a (a 4.3-BSD style `struct direct'). Make sure you've got /bin ahead of /usr/ucb in your $PATH when building bash. This will ensure that you use /bin/cc or acc instead of /usr/ucb/cc and that you link with libc before libucb. 20) Why doesn't bash treat brace expansions exactly like csh? The only difference between bash and csh brace expansion is that bash requires a brace expression to contain at least on unquoted comma if it is to be expanded. Any brace-surrounded word not containing an unquoted comma is left unchanged by the brace expansion code. This affords the greatest degree of sh compatibility. Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. 21) Why does bash dump core after I interrupt username completion on a machine running NIS? This is a famous and long-standing bug in the SunOS YP (sorry, NIS) client library, which is part of libc. The YP library code keeps static state -- a pointer into the data returned from the server. When YP initializes itself (setpwent), it looks at this pointer and calls free on it if it's non-null. So far, so good. If one of the YP functions is interrupted during getpwent (the exact function is interpretwithsave()), and returns NULL, the pointer is freed without being reset to NULL, and the function returns. The next time getpwent is called, it sees that this pointer is non-null, calls free, and the bash free() blows up because it's being asked to free freed memory. The traditional Unix mallocs allow memory to be freed multiple times; that's probably why this has never been fixed. You can probably stop it by adding an #undef USE_GNU_MALLOC to the appropriate machine description in machines.h. 22) I'm running SVR4.2. Why is the line erased every time I type `@'? The `@' character is the default `line kill' character in most versions of System V, including SVR4.2. You can change this character to whatever you want using `stty'. For example, to change the line kill character to control-u, type stty kill ^U where the `^' and `U' can be two separate characters. 23) How can I find the value of a shell variable whose name is the value of another shell variable? Use the `eval' builtin. The important thing to remember is that `eval' expands the arguments you give it again, so you need to quote the parts of the arguments that you want `eval' to act on. For example, this expression prints the value of the last positional parameter: eval echo \$\{$#\} The expansion of the quoted portions of this expression will be deferred until `eval' runs, while the `$#' will be expanded before `eval' is executed. 24) If I pipe the output of a command into `read variable', why doesn't the output show up in $variable when the read command finishes? This has to do with the parent-child relationship between Unix processes. Each element of a pipeline runs in a separate process, a child of the shell running the pipeline. A subprocess cannot affect its parent's environment. When the `read' command sets the variable to the input, that variable is set only in the subshell, not the parent shell. When the subshell exits, the value of the variable is lost. Many pipelines that end with `read variable' can be converted into command substitutions, which will capture the output into a variable: grep ^gnu /usr/lib/news/active | wc -l | read ngroup can be converted into ngroup=$(grep ^gnu /usr/lib/news/active | wc -l) This does not, unfortunately, work to split the text among multiple variables, as read does when given multiple variable arguments. 25) I just changed my shell to bash, and now I can't FTP into my machine. Why not? You must add the full pathname to bash to the file /etc/shells. Many versions of ftpd use this file to prohibit `special' users such as `uucp' and `news' from using FTP. 26) I have a bunch of shell scripts that use backslash-escaped characters in arguments to `echo'. Bash doesn't interpret these characters. Why not, and how can I make it understand them? This is the behavior of echo on most Unix System V machines. The bash builtin `echo' is modelled after the 9th Edition Research Unix version of `echo'. It does not interpret backslash-escaped characters in its argument strings by default, but requires the use of the -e option to enable the interpretation. The System V echo provides no way to disable the special characters; the bash echo has a -E option to disable them. There is a compile-time option that will make bash behave like the System V echo and interpret things like \t by default. Change config.h so that DEFAULT_ECHO_TO_USG is defined, remove builtins/libbuiltins.a and builtins/echo.o, and rebuild. 27) Why doesn't bash have csh variable modifiers? Posix has specified a more powerful, albeit somewhat more confusing, mechanism cribbed from ksh, and bash implements it. ${parameter%word} Remove smallest suffix pattern. The WORD is expanded to produce a pattern. It then expands to the value of PARAMETER, with the smallest portion of the suffix matched by the pattern deleted. x=file.c echo ${x%.c}.o -->file.o ${parameter%%word} Remove largest suffix pattern. The WORD is expanded to produce a pattern. It then expands to the value of PARAMETER, with the largest portion of the suffix matched by the pattern deleted. x=posix/src/std echo ${x%%/*} -->posix ${parameter#word} Remove smallest prefix pattern. The WORD is expanded to produce a pattern. It then expands to the value of PARAMETER, with the smallest portion of the prefix matched by the pattern deleted. x=$HOME/src/cmd echo ${x#$HOME} -->/src/cmd ${parameter##word} Remove largest prefix pattern. The WORD is expanded to produce a pattern. It then expands to the value of PARAMETER, with the largest portion of the prefix matched by the pattern deleted. x=/one/two/three echo ${x##*/} -->three Given a=/a/b/c/d b=b.xxx csh bash result --- ---- ------ $a:h ${a%/*} /a/b/c $a:t ${a##*/} d $b:r ${b%.*} b $b:e ${b##*.} xxx 28) How do I report bugs in bash, and where should I look for fixes and advice? Use the `bashbug' script to report bugs. It is built and installed at the same time as bash. It provides a standard template for reporting a problem and automatically includes information about your configuration and build environment. `bashbug' sends its reports to bug...@pr..., which is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. Bug fixes, answers to questions, and announcements of new releases are all posted to gnu.bash.bug. Discussions concerning bash features and problems also take place there. To reach the bash maintainers directly, send mail to bas...@pr.... 29) What kind of bash documentation is there? First, look in the documentation directory in the bash distribution. It should contain the following files: bash.1 an extensive, thorough Unix-style manual page builtins.1 a manual page covering just bash builtin commands features.texi a Gnu-style info file overview FAQ this file article.ms text of an article written for The Linux Journal readline.3 a man page describing readline Postscript files created from the above source are also present in the distribution. There is additional documentation available for anonymous FTP from host slc2.ins.cwru.edu in the `pub/bash' directory. Cameron Newham is in the midst of writing a book on bash, to be published by O'Reilly and Associates. Look for it sometime this year. 30) What's coming in future versions? There will be no new features in future releases of version 1.14. The next major release, bash-2.0, will contain extensive changes and new features. Here's a short list: one-dimensional arrays with a new compound assignment statement, appropriate expansion constructs and modifications to some of the builtins (read, declare, etc.) to use them new expansions to do ANSI-C string expansion, substring extraction, pattern replacement, and indirect variable expansion new builtins: `disown' and `shopt' new variables: HISTIGNORE, SHELLOPTS, PIPESTATUS, DIRSTACK special handling of many unused or redundant variables removed dynamic loading of new builtin commands; many loadable examples provided new prompt expansions: \e, \n, \H, \T new readline variables: enable-keypad, mark-directories, input-meta new readline commands to manipulate the mark and operate on the region new readline emacs mode commands and bindings for ksh-88 compatibility updated and extended builtins new DEBUG trap expanded (and now documented) restricted shell mode implementation stuff: autoconf-based configuration nearly all of the bugs reported since version 1.14 have been fixed most builtins converted to use builtin `getopt' for consistency most builtins use -p option to display output in a reusable form (for consistency) grammar tighter and smaller (66 reduce-reduce conflicts gone) lots of code now smaller and faster test suite greatly expanded 31) What's on the bash `wish list'? internationalization with a variable expansion to translate a string according to a particular message catalog Programmable completion a la zsh menu completion a la tcsh the ksh egrep-style extended pattern matching operators associative arrays (not really all that hard) breaking some of the shell functionality into embeddable libraries a bash debugger Much of this will not be in bash-2.0. 32) When will the next release appear? There will probably be a 1.14.5 release to coincide with the next GNU source CD. That will be the last release for version 1.14. The next version will appear sometime in 1995. Never make predictions. |
From: Enrico B. <enr...@us...> - 2002-03-11 02:03:13
|
Update of /cvsroot/winbash/winbash In directory usw-pr-cvs1:/tmp/cvs-serv27612 Removed Files: FAQ Log Message: moved FAQ to documentation subdir --- FAQ DELETED --- |