Imported from ../bash-2.02.1.tar.gz.
This commit is contained in:
		
					parent
					
						
							
								cce855bc5b
							
						
					
				
			
			
				commit
				
					
						bc4cd23ce9
					
				
			
		
					 23 changed files with 204 additions and 70 deletions
				
			
		
							
								
								
									
										55
									
								
								CHANGES
									
										
									
									
									
								
							
							
						
						
									
										55
									
								
								CHANGES
									
										
									
									
									
								
							|  | @ -1,5 +1,56 @@ | |||
| This document details the changes between this version, bash-2.02-beta2, | ||||
| and the previous version, bash-2.02-beta1. | ||||
| This document details the changes between this version, bash-2.02.1-release, | ||||
| and the previous version, bash-2.02-release. | ||||
| 
 | ||||
| 1.  Changes to Bash | ||||
| 
 | ||||
| a.  A bug that caused the bash readline support to not compile unless aliases | ||||
|     and csh-style history were configured into the shell was fixed. | ||||
| 
 | ||||
| b.  Fixed a bug that could cause a core dump when here documents contained | ||||
|     more than 1000 characters. | ||||
| 
 | ||||
| c.  Fixed a bug that caused a CDPATH entry of "" to not be treated the same | ||||
|     as the current directory when in POSIX mode. | ||||
| 
 | ||||
| d.  Fixed an alignment problem with the memory returned by the bash malloc, | ||||
|     so returned memory is now 64-bit aligned. | ||||
| 
 | ||||
| e.  Fixed a bug that caused command substitutions executed within pipelines | ||||
|     to put the terminal in the wrong process group. | ||||
| 
 | ||||
| f.  Fixes to support/config.sub for: alphas, SCO Open Server and Open Desktop, | ||||
|     Unixware 2, and Unixware 7. | ||||
| 
 | ||||
| g.  Fixes to the pattern matching code to make it work correctly for eight-bit | ||||
|     characters. | ||||
| 
 | ||||
| h.  Fixed a problem that occasionally caused the shell to display the wrong | ||||
|     value for the new working directory when changing to a directory found | ||||
|     in $CDPATH when in physical mode. | ||||
| 
 | ||||
| i.  Fixed a bug that caused core dumps when using conditional commands in | ||||
|     shell functions. | ||||
| 
 | ||||
| j.  Fixed a bug that caused the printf builtin to loop forever if the format | ||||
|     string did not consume any of the arguments. | ||||
| 
 | ||||
| k.  Fixed a bug in the parameter expansion code that caused "$@" to be | ||||
|     incorrectly split if $IFS did not contain a space character. | ||||
| 
 | ||||
| l.  Fixed a bug that could cause a core dump when completing hostnames if | ||||
|     the number of matching hostnames was an exact multiple of 16. | ||||
| 
 | ||||
| m.  Fixed a bug that caused the shell to fork too early when a command | ||||
|     such as `%2 &' was given. | ||||
| 
 | ||||
| 2.  Changes to Readline | ||||
| 
 | ||||
| a.  Fixed a problem with redisplay that showed up when the prompt string was | ||||
|     longer than the screen width and the prompt contained invisible characters. | ||||
| 
 | ||||
| ------------------------------------------------------------------------------ | ||||
| This document details the changes between this version, bash-2.02-release, | ||||
| and the previous version, bash-2.02-beta2. | ||||
| 
 | ||||
| 1.  Changes to Bash | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										4
									
								
								INSTALL
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								INSTALL
									
										
									
									
									
								
							|  | @ -29,8 +29,8 @@ this, make sure you are using Autoconf version 2.10 or newer. | |||
| If you need to change `configure.in' or regenerate `configure', you | ||||
| will need to create two files: `_distribution' and `_patchlevel'. | ||||
| `_distribution' should contain the major and minor version numbers of | ||||
| the Bash distribution, for example `2.01'.  `_patchlevel' should | ||||
| contain the patch level of the Bash distribution, `0' for example.  The | ||||
| the Bash distribution, for example `2.02'.  `_patchlevel' should | ||||
| contain the patch level of the Bash distribution, `1' for example.  The | ||||
| script `support/mkconffiles' has been provided to automate the creation | ||||
| of these files. | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										20
									
								
								NOTES
									
										
									
									
									
								
							
							
						
						
									
										20
									
								
								NOTES
									
										
									
									
									
								
							|  | @ -3,12 +3,14 @@ Platform-Specific Configuration and Operation Notes | |||
| 
 | ||||
| 1.  configure --without-gnu-malloc on: | ||||
| 
 | ||||
| 	alpha running OSF/1 | ||||
| 	alpha running Linux | ||||
| 	alpha running OSF/1, Linux, or NetBSD (malloc needs 8-byte alignment; | ||||
| 	bash malloc has 8-byte alignment now, but I have no alphas to test on) | ||||
| 
 | ||||
| 	next running NeXT/OS | ||||
| 
 | ||||
| 	all machines running SunOS YP code: SunOS4, SunOS5, HP/UX | ||||
| 	all machines running SunOS YP code: SunOS4, SunOS5, HP/UX, if you | ||||
| 	have problems with username completion or tilde expansion for | ||||
| 	usernames found via YP/NIS | ||||
| 
 | ||||
| 	linux (optional, but don't do it if you're using Doug Lea's malloc) | ||||
| 
 | ||||
|  | @ -19,16 +21,18 @@ Platform-Specific Configuration and Operation Notes | |||
| 	DG/UX | ||||
| 	Cray | ||||
| 
 | ||||
| 	NetBSD/sparc (malloc needs 8-byte alignment; GNU malloc has 4-byte) | ||||
| 	NetBSD/sparc (malloc needs 8-byte alignment; bash malloc has 8-byte | ||||
| 	alignment now, but I have no NetBSD machines to test on) | ||||
| 
 | ||||
| 	BSD/OS 2.1 if you want to use loadable builtins | ||||
| 	BSD/OS 2.1, 3.x if you want to use loadable builtins | ||||
| 
 | ||||
| 	If you are using GNU libc, especially on a linux system | ||||
| 
 | ||||
| (Configuring --without-gnu-malloc will still result in lib/malloc/libmalloc.a | ||||
| being built and linked against, but there is only a stub file in the archive.) | ||||
| 
 | ||||
| 2.  configure using shlicc on BSD/OS 2.1 to use loadable builtins | ||||
| 2.  Configure using shlicc2 on BSD/OS 2.1 and BSD/OS 3.x to use loadable | ||||
|     builtins | ||||
| 
 | ||||
| 3.  Bash cannot be built in a directory separate from the source directory | ||||
|     using configure --srcdir=... unless the version of `make' you're using | ||||
|  | @ -44,8 +48,8 @@ being built and linked against, but there is only a stub file in the archive.) | |||
|     fixes the problem. | ||||
| 
 | ||||
| 5.  There is a problem with Red Hat Linux's `makewhatis' script. | ||||
|     Running `makewhatis' with bash-2.0 results in error messages | ||||
|     like this: | ||||
|     Running `makewhatis' with bash-2.0 or later versions results | ||||
|     in error messages like this: | ||||
| 
 | ||||
|     /usr/sbin/makewhatis: cd: manpath: No such file or directory | ||||
|     /usr/sbin/makewhatis: manpath/whatis: No such file or directory | ||||
|  |  | |||
							
								
								
									
										6
									
								
								README
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								README
									
										
									
									
									
								
							|  | @ -1,7 +1,7 @@ | |||
| Introduction | ||||
| ============ | ||||
| 
 | ||||
| This is GNU Bash, version 2.01.  Bash is the GNU Project's Bourne | ||||
| This is GNU Bash, version 2.02.1.  Bash is the GNU Project's Bourne | ||||
| Again SHell, a complete implementation of the POSIX.2 shell spec, | ||||
| but also with interactive command line editing, job control on | ||||
| architectures that support it, csh-like features such as history | ||||
|  | @ -49,7 +49,7 @@ more ambitious script that attempts to do a more complete job. | |||
| Reporting Bugs | ||||
| ============== | ||||
| 
 | ||||
| Bug reports for bash-2.01 should be sent to: | ||||
| Bug reports for bash-2.02.1 should be sent to: | ||||
| 
 | ||||
| 	bug-bash@prep.ai.mit.edu | ||||
| 
 | ||||
|  | @ -67,7 +67,7 @@ bashbug directly with `make bashbug'.  If you cannot build `bashbug', | |||
| please send mail to bug-bash@prep.ai.mit.edu with the following | ||||
| information: | ||||
| 
 | ||||
| 	* the version number and release status of Bash (e.g., 2.01-release) | ||||
| 	* the version number and release status of Bash (e.g., 2.02.1-release) | ||||
| 	* the machine and OS that it is running on (look at the file | ||||
| 	  `.made' in the bash build directory) | ||||
| 	* a list of the compilation flags or the contents of `config.h', if | ||||
|  |  | |||
|  | @ -213,7 +213,9 @@ initialize_readline () | |||
| 
 | ||||
| #ifdef ALIAS | ||||
|   rl_add_defun ("alias-expand-line", (Function *)alias_expand_line, -1); | ||||
| #  ifdef BANG_HISTORY | ||||
|   rl_add_defun ("history-and-alias-expand-line", (Function *)history_and_alias_expand_line, -1); | ||||
| #  endif | ||||
| #endif | ||||
| 
 | ||||
|   /* Backwards compatibility. */ | ||||
|  | @ -538,7 +540,7 @@ hostnames_matching (text) | |||
|         continue; | ||||
| 
 | ||||
|       /* OK, it matches.  Add it to the list. */ | ||||
|       if (nmatch >= rsize) | ||||
|       if (nmatch >= (rsize - 1)) | ||||
| 	{ | ||||
| 	  rsize = (rsize + 16) - (rsize % 16); | ||||
| 	  result = (char **)xrealloc (result, rsize * sizeof (char *)); | ||||
|  |  | |||
|  | @ -263,7 +263,7 @@ cd_builtin (list) | |||
| 		     directory name is echoed to stdout, whether or not | ||||
| 		     the shell is interactive. */ | ||||
| 		  if (opt) | ||||
| 		    printf ("%s\n", the_current_working_directory); | ||||
| 		    printf ("%s\n", no_symlinks ? temp : the_current_working_directory); | ||||
| 
 | ||||
| 		  free (temp); | ||||
| 		  /* Posix.2 says that after using CDPATH, the resultant | ||||
|  | @ -276,8 +276,10 @@ cd_builtin (list) | |||
| 
 | ||||
| 	  /* POSIX.2 says that if `.' does not appear in $CDPATH, we don't | ||||
| 	     try the current directory, so we just punt now with an error | ||||
| 	     message if POSIXLY_CORRECT is non-zero. */ | ||||
| 	  if (posixly_correct) | ||||
| 	     message if POSIXLY_CORRECT is non-zero.  The check for cdpath[0] | ||||
| 	     is so we don't mistakenly treat a CDPATH value of "" as not | ||||
| 	     specifying the current directory. */ | ||||
| 	  if (posixly_correct && cdpath[0]) | ||||
| 	    { | ||||
| 	      builtin_error ("%s: %s", dirname, strerror (ENOENT)); | ||||
| 	      return (EXECUTION_FAILURE); | ||||
|  |  | |||
|  | @ -191,6 +191,11 @@ exec_builtin (list) | |||
| #endif /* JOB_CONTROL */ | ||||
| 
 | ||||
|   shell_execve (command, args, env); | ||||
| 
 | ||||
|   /* We have to set this to NULL because shell_execve has called realloc() | ||||
|      to stuff more items at the front of the array, which may have caused | ||||
|      the memory to be freed by realloc().  We don't want to free it twice. */ | ||||
|   args = (char **)NULL; | ||||
|   if (cleanenv == 0) | ||||
|     adjust_shell_level (1); | ||||
| 
 | ||||
|  |  | |||
|  | @ -129,6 +129,10 @@ printf_builtin (list) | |||
| 
 | ||||
|   garglist = list->next; | ||||
| 
 | ||||
|   /* If the format string is empty after preprocessing, return immediately. */ | ||||
|   if (format == 0 || *format == 0) | ||||
|     return (EXECUTION_SUCCESS); | ||||
| 	   | ||||
|   /* Basic algorithm is to scan the format string for conversion | ||||
|      specifications -- once one is found, find out if the field | ||||
|      width or precision is a '*'; if it is, gather up value.  Note, | ||||
|  | @ -305,7 +309,7 @@ printf_builtin (list) | |||
| 	  fmt[1] = nextch; | ||||
| 	} | ||||
|     } | ||||
|   while (garglist); | ||||
|   while (garglist && garglist != list->next); | ||||
| 
 | ||||
|   PRETURN (retval); | ||||
| } | ||||
|  |  | |||
							
								
								
									
										4
									
								
								configure
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								configure
									
										
									
									
										vendored
									
									
								
							|  | @ -725,7 +725,7 @@ alpha-*)	opt_gnu_malloc=no ;;	# alpha running osf/1 or linux | |||
| *-osf1*)	opt_gnu_malloc=no ;;	# other osf/1 machines | ||||
| sparc-svr4*)	opt_gnu_malloc=no ;;	# sparc SVR4, SVR4.2 | ||||
| sparc-netbsd*)	opt_gnu_malloc=no ;;	# needs 8-byte alignment | ||||
| sgi-irix6*)	opt_gnu_malloc=no ;;	# needs 8-byte alignment | ||||
| #mips-irix6*)	opt_gnu_malloc=no ;;	# needs 8-byte alignment | ||||
| sparc-linux*)	opt_gnu_malloc=no ;;	# sparc running linux; requires ELF | ||||
| #*-freebsd*)	opt_gnu_malloc=no ;;	# they claim it's better | ||||
| *-aix*)		opt_gnu_malloc=no ;;	# AIX machines | ||||
|  | @ -1113,7 +1113,7 @@ fi | |||
| 
 | ||||
| 
 | ||||
| BASHVERS=2.02 | ||||
| BASHPATCH=0 | ||||
| BASHPATCH=1 | ||||
| 
 | ||||
| echo "Beginning configuration for bash-$BASHVERS for ${host_cpu}-${host_vendor}-${host_os}" | ||||
| 
 | ||||
|  |  | |||
|  | @ -38,7 +38,7 @@ alpha-*)	opt_gnu_malloc=no ;;	# alpha running osf/1 or linux | |||
| *-osf1*)	opt_gnu_malloc=no ;;	# other osf/1 machines | ||||
| sparc-svr4*)	opt_gnu_malloc=no ;;	# sparc SVR4, SVR4.2 | ||||
| sparc-netbsd*)	opt_gnu_malloc=no ;;	# needs 8-byte alignment | ||||
| sgi-irix6*)	opt_gnu_malloc=no ;;	# needs 8-byte alignment | ||||
| #mips-irix6*)	opt_gnu_malloc=no ;;	# needs 8-byte alignment | ||||
| sparc-linux*)	opt_gnu_malloc=no ;;	# sparc running linux; requires ELF | ||||
| #*-freebsd*)	opt_gnu_malloc=no ;;	# they claim it's better | ||||
| *-aix*)		opt_gnu_malloc=no ;;	# AIX machines | ||||
|  |  | |||
|  | @ -229,7 +229,8 @@ copy_cond_command (com) | |||
|   new_cond = (COND_COM *)xmalloc (sizeof (COND_COM)); | ||||
|   new_cond->flags = com->flags; | ||||
|   new_cond->line = com->line; | ||||
|   new_cond->op = copy_word (com->op); | ||||
|   new_cond->type = com->type; | ||||
|   new_cond->op = com->op ? copy_word (com->op) : com->op; | ||||
|   new_cond->left = com->left ? copy_cond_command (com->left) : (COND_COM *)NULL; | ||||
|   new_cond->right = com->right ? copy_cond_command (com->right) : (COND_COM *)NULL; | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										48
									
								
								doc/FAQ
									
										
									
									
									
								
							
							
						
						
									
										48
									
								
								doc/FAQ
									
										
									
									
									
								
							|  | @ -1,4 +1,4 @@ | |||
| This is the Bash FAQ, version 2.11, for Bash version 2.02. | ||||
| This is the Bash FAQ, version 2.13, for Bash version 2.02. | ||||
| 
 | ||||
| This document contains a set of frequently-asked questions concerning | ||||
| Bash, the GNU Bourne-Again Shell.  Bash is a freely-available command | ||||
|  | @ -150,9 +150,10 @@ More information appears in the file `INSTALL' in the distribution. | |||
| 5) Will bash run on operating systems other than Unix? | ||||
| 
 | ||||
| Configuration specifics for Unix-like systems such as QNX and | ||||
| LynxOS are included in the distribution.  Previous versions of | ||||
| bash have been ported to Minix, but I don't believe anyone has | ||||
| built bash-2.x on Minix yet. | ||||
| LynxOS are included in the distribution.  Bash-2.02 should  | ||||
| compile and run on Minix 2.0 (patches were contributed), but I | ||||
| don't believe anyone has built bash-2.x on earlier Minix versions | ||||
| yet. | ||||
| 
 | ||||
| Bash has been ported to versions of Windows implementing the Win32 | ||||
| programming interface.  This includes Windows 95 and Windows NT. | ||||
|  | @ -174,9 +175,9 @@ The Cygnus port works only on Intel machines.  There is a port of bash | |||
| 
 | ||||
| ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz | ||||
| 
 | ||||
| Softway Systems has ported bash-2.01.1 to their OpenNT system, a | ||||
| Unix subsystem for NT that replaces the Microsoft POSIX subsystem. | ||||
| Check out http://www.opennt.com for more information. | ||||
| Softway Systems has ported bash-2.01.1 to their Interix (nee OpenNT) | ||||
| system, a Unix subsystem for NT that replaces the Microsoft POSIX | ||||
| subsystem.  Check out http://www.interix.com for more information. | ||||
| 
 | ||||
| D. J. Delorie has ported bash-1.14.7 to run under MS-DOS, as part of | ||||
| the DJGPP project.  For more information on the project, see | ||||
|  | @ -403,6 +404,8 @@ Things bash has that sh does not: | |||
| 	the select compound command and reserved word | ||||
| 	new $'...' and $"..." quoting | ||||
| 	the $(...) form of command substitution | ||||
| 	the $(<filename) form of command substitution, equivalent to | ||||
| 		$(cat filename) | ||||
| 	the ${#param} parameter value length operator | ||||
| 	the ${!param} indirect parameter expansion operator | ||||
| 	the ${param:length[:offset]} parameter substring operator | ||||
|  | @ -413,7 +416,7 @@ Things bash has that sh does not: | |||
| 		   TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS, | ||||
| 		   LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME, | ||||
| 		   ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE, | ||||
| 		   HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, | ||||
| 		   HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS, | ||||
| 		   PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC, | ||||
| 		   SHELLOPTS, OPTERR, HOSTFILE, TMOUT, histchars, auto_resume | ||||
| 	DEBUG trap | ||||
|  | @ -436,6 +439,7 @@ Things bash has that sh does not: | |||
| 	brace expansion | ||||
| 	tilde expansion | ||||
| 	arithmetic expansion with $((...)) and `let' builtin | ||||
| 	the `[[...]]' extended conditional command | ||||
| 	process substitution | ||||
| 	aliases and alias/unalias builtins | ||||
| 	local variables in functions and `local' builtin | ||||
|  | @ -444,9 +448,14 @@ Things bash has that sh does not: | |||
| 	csh-like history expansion | ||||
| 	other new bash builtins: bind, command, builtin, declare/typeset, | ||||
| 				 dirs, enable, fc, help, history, logout, | ||||
| 				 popd, pushd, disown, shopt | ||||
| 				 popd, pushd, disown, shopt, printf | ||||
| 	exported functions | ||||
| 	filename generation when using output redirection (command >a*) | ||||
| 	POSIX.2-style globbing character classes | ||||
| 	POSIX.2-style globbing equivalence classes | ||||
| 	POSIX.2-style globbing collating symbols | ||||
| 	egrep-like extended pattern matching operators | ||||
| 	case-insensitive pattern matching and globbing | ||||
| 	variable assignments preceding commands affect only that command, | ||||
| 		even for builtins and functions | ||||
| 	posix mode | ||||
|  | @ -493,7 +502,7 @@ Things bash has or uses that ksh88 does not: | |||
| 		   HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND, | ||||
| 		   IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK, | ||||
| 		   PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE, | ||||
| 		   histchars, auto_resume | ||||
| 		   GROUPS, histchars, auto_resume | ||||
| 	prompt expansion with backslash escapes and command substitution | ||||
| 	redirection: &> (stdout and stderr) | ||||
| 	more extensive and extensible editing and completion | ||||
|  | @ -504,15 +513,18 @@ Things bash has or uses that ksh88 does not: | |||
| 		  -o histexpand/-o interactive-comments/-o notify/-o physical/ | ||||
| 		  -o posix/-o hashall/-o onecmd/-h/-B/-C/-b/-H/-P, set +o, | ||||
| 		  suspend, trap -l, type, typeset -a/-F/-p, ulimit -u, | ||||
| 		  umask -S, alias -p, shopt, disown | ||||
| 		  umask -S, alias -p, shopt, disown, printf | ||||
| 	`!' csh-style history expansion | ||||
| 	POSIX.2-style globbing character classes | ||||
| 	POSIX.2-style globbing equivalence classes | ||||
| 	POSIX.2-style globbing collating symbols | ||||
| 	egrep-like extended pattern matching operators | ||||
| 	case-insensitive pattern matching and globbing | ||||
| 	`**' arithmetic operator to do exponentiation | ||||
| 
 | ||||
| Things ksh88 has or uses that bash does not: | ||||
| 	new version of test: [[...]] | ||||
| 	tracked aliases | ||||
| 	$(<file)	 | ||||
| 	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 | ||||
|  | @ -547,7 +559,7 @@ New things in ksh-93 not in bash-2.02: | |||
| 	variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, HISTEDIT, | ||||
| 		   .sh.version, .sh.name, .sh.subscript, .sh.value | ||||
| 	backreferences in pattern matching | ||||
| 	print -f (bash has a loadable version) | ||||
| 	print -f (bash has a loadable version of print and the printf builtin) | ||||
| 	`fc' has been renamed to `hist' | ||||
| 	read -t/-d | ||||
| 	`.' can execute shell functions | ||||
|  | @ -712,12 +724,8 @@ Most, however, can be emulated with very little trouble. | |||
| 
 | ||||
| ksh-88 feature		Bash equivalent | ||||
| --------------		--------------- | ||||
| [[...]]			can usually use [...]; minor differences (no | ||||
| 			pattern matching, for one) | ||||
| compiled-in aliases	set up aliases in .bashrc; some ksh aliases are | ||||
| 			bash builtins (hash, history, type) | ||||
| $(<file)		$(cat file) | ||||
| extended patterns	no good substitute | ||||
| coprocesses		named pipe pairs (one for read, one for write) | ||||
| typeset +f		declare -F | ||||
| cd, print, whence	function substitutes in examples/functions/kshenv | ||||
|  | @ -1146,7 +1154,7 @@ is 1-56592-147-X.  Look for it in fine bookstores near you.  This book | |||
| covers bash-1.14, but has an appendix describing some of the new features | ||||
| in bash-2.0.   | ||||
| 
 | ||||
| A second edition of this book is available, just published in January, 1998. | ||||
| A second edition of this book is available, published in January, 1998. | ||||
| The ISBN number is 1-56592-347-2.  Look for it in the same fine bookstores | ||||
| or on the web. | ||||
| 
 | ||||
|  |  | |||
|  | @ -77,6 +77,7 @@ case "$1" in | |||
|     # Start value only | ||||
|     count=${1%-} | ||||
|     forever=1 | ||||
|     end="-1"; | ||||
|     ;; | ||||
| -[0-9]*-[0-9]*|[0-9]*-[0-9]*) | ||||
|     # Start and end value | ||||
|  | @ -92,6 +93,7 @@ case "$1" in | |||
|     ;; | ||||
| -) | ||||
|     forever=1 | ||||
|     end="-1"; | ||||
|     ;; | ||||
| *)  | ||||
|     echo "$name: bad count parameter: $1" 1>&2 | ||||
|  |  | |||
|  | @ -2276,7 +2276,7 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close) | |||
| { | ||||
|   WORD_LIST *words, *lastword; | ||||
|   char *command_line, *lastarg, *temp; | ||||
|   int first_word_quoted, result, builtin_is_special, already_forked; | ||||
|   int first_word_quoted, result, builtin_is_special, already_forked, dofork; | ||||
|   pid_t old_last_command_subst_pid; | ||||
|   Function *builtin; | ||||
|   SHELL_VAR *func; | ||||
|  | @ -2298,8 +2298,23 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close) | |||
| 
 | ||||
|   old_last_command_subst_pid = last_command_subst_pid; | ||||
| 
 | ||||
|   already_forked = 0; | ||||
|   if (pipe_in != NO_PIPE || pipe_out != NO_PIPE || async) | ||||
|   already_forked = dofork = 0; | ||||
| 
 | ||||
|   /* If we're in a pipeline or run in the background, set DOFORK so we
 | ||||
|      make the child early, before word expansion.  This keeps assignment | ||||
|      statements from affecting the parent shell's environment when they | ||||
|      should not. */ | ||||
|   dofork = pipe_in != NO_PIPE || pipe_out != NO_PIPE || async; | ||||
| 
 | ||||
|   /* Something like `%2 &' should restart job 2 in the background, not cause
 | ||||
|      the shell to fork here. */ | ||||
|   if (dofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE && | ||||
| 	simple_command->words && simple_command->words->word && | ||||
| 	simple_command->words->word->word && | ||||
| 	(simple_command->words->word->word[0] == '%')) | ||||
|     dofork = 0; | ||||
| 
 | ||||
|   if (dofork) | ||||
|     { | ||||
|       /* XXX memory leak if expand_words() error causes a jump_to_top_level */ | ||||
|       command_line = savestring (the_printed_command); | ||||
|  | @ -2312,7 +2327,7 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close) | |||
| 	  do_piping (pipe_in, pipe_out); | ||||
| 	  pipe_in = pipe_out = -1; | ||||
| 
 | ||||
| 	  subshell_environment = SUBSHELL_ASYNC; | ||||
| 	  subshell_environment = async ? SUBSHELL_ASYNC : SUBSHELL_FORK; | ||||
| 	} | ||||
|       else | ||||
| 	{ | ||||
|  |  | |||
							
								
								
									
										6
									
								
								jobs.c
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								jobs.c
									
										
									
									
									
								
							|  | @ -925,9 +925,9 @@ print_pipeline (p, job_index, format, stream) | |||
| 	  else | ||||
| 	    { | ||||
| 	      if (WIFSTOPPED (show->status)) | ||||
| 		temp = strsignal (WSTOPSIG (show->status)); | ||||
| 		temp = (char *)strsignal (WSTOPSIG (show->status)); | ||||
| 	      else if (WIFSIGNALED (show->status)) | ||||
| 		temp = strsignal (WTERMSIG (show->status)); | ||||
| 		temp = (char *)strsignal (WTERMSIG (show->status)); | ||||
| 	      else if (WIFEXITED (show->status)) | ||||
| 		{ | ||||
| 		  temp = retcode_name_buffer; | ||||
|  | @ -1191,7 +1191,7 @@ make_child (command, async_p) | |||
| 	  if (pipeline_pgrp == mine) | ||||
| 	    { | ||||
| #endif | ||||
| 	      if (async_p == 0) | ||||
| 	      if (async_p == 0 && pipeline_pgrp != shell_pgrp) | ||||
| 		give_terminal_to (pipeline_pgrp); | ||||
| 
 | ||||
| #if defined (PGRP_PIPE) | ||||
|  |  | |||
|  | @ -37,9 +37,6 @@ static int extmatch (); | |||
| 
 | ||||
| /* Note that these evaluate C many times.  */ | ||||
| 
 | ||||
| #define ISUPPER(c)	(isascii (c) && isupper (c)) | ||||
| #define ISLOWER(c)	(isascii (c) && islower (c)) | ||||
| 
 | ||||
| #ifndef isblank | ||||
| #  define isblank(c)	((c) == ' ' || (c) == '\t') | ||||
| #endif | ||||
|  | @ -52,7 +49,10 @@ static int extmatch (); | |||
| #  define isxdigit(c)	(((c) >= '0' && (c) <= '9') || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) | ||||
| #endif | ||||
| 
 | ||||
| # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) | ||||
| /* The result of FOLD is an `unsigned char' */ | ||||
| # define FOLD(c) ((flags & FNM_CASEFOLD) && isupper ((unsigned char)c) \ | ||||
| 	? tolower ((unsigned char)c) \ | ||||
| 	: ((unsigned char)c)) | ||||
| 
 | ||||
| #ifndef STREQ | ||||
| #define STREQ(a, b) ((a)[0] == (b)[0] && strcmp(a, b) == 0) | ||||
|  | @ -190,7 +190,7 @@ gmatch (string, se, pattern, pe, flags) | |||
| 		return FNM_NOMATCH; | ||||
| 	      c = FOLD (c); | ||||
| 	    } | ||||
| 	  if (FOLD (sc) != c) | ||||
| 	  if (FOLD (sc) != (unsigned char)c) | ||||
| 	    return FNM_NOMATCH; | ||||
| 	  break; | ||||
| 
 | ||||
|  | @ -240,9 +240,9 @@ gmatch (string, se, pattern, pe, flags) | |||
| 
 | ||||
| 	  /* General case, use recursion. */ | ||||
| 	  { | ||||
| 	    char c1; | ||||
| 	    unsigned char c1; | ||||
| 
 | ||||
| 	    c1 = ((flags & FNM_NOESCAPE) == 0 && c == '\\') ? *p : c; | ||||
| 	    c1 = (unsigned char)((flags & FNM_NOESCAPE) == 0 && c == '\\') ? *p : c; | ||||
| 	    c1 = FOLD (c1); | ||||
| 	    for (--p; n < se; ++n) | ||||
| 	      /* Only call fnmatch if the first character indicates a
 | ||||
|  | @ -272,7 +272,7 @@ gmatch (string, se, pattern, pe, flags) | |||
| 	  break; | ||||
| 
 | ||||
| 	default: | ||||
| 	  if (c != FOLD (sc)) | ||||
| 	  if ((unsigned char)c != FOLD (sc)) | ||||
| 	    return (FNM_NOMATCH); | ||||
| 	} | ||||
| 
 | ||||
|  | @ -378,7 +378,7 @@ brackmatch (p, test, flags) | |||
| 	  else if (STREQN (p+1, "graph:]", 7)) | ||||
| 	    { pc = isgraph (test); p += 8; } | ||||
| 	  else if (STREQN (p+1, "lower:]", 7)) | ||||
| 	    { pc = ISLOWER (test); p += 8; } | ||||
| 	    { pc = islower (test); p += 8; } | ||||
| 	  else if (STREQN (p+1, "print:]", 7)) | ||||
| 	    { pc = isprint (test); p += 8; } | ||||
| 	  else if (STREQN (p+1, "punct:]", 7)) | ||||
|  | @ -386,7 +386,7 @@ brackmatch (p, test, flags) | |||
| 	  else if (STREQN (p+1, "space:]", 7)) | ||||
| 	    { pc = isspace (test); p += 8; } | ||||
| 	  else if (STREQN (p+1, "upper:]", 7)) | ||||
| 	    { pc = ISUPPER (test); p += 8; } | ||||
| 	    { pc = isupper (test); p += 8; } | ||||
| 	  else if (STREQN (p+1, "xdigit:]", 8)) | ||||
| 	    { pc = isxdigit (test); p += 9; } | ||||
| 	  else if (STREQN (p+1, "ascii:]", 7)) | ||||
|  |  | |||
|  | @ -184,7 +184,7 @@ struct bucket_stats { | |||
|    enough room in the block for the new size.  Range checking is always | ||||
|    done. */ | ||||
| union mhead { | ||||
|   union mhead *mh_align; | ||||
|   double mh_align; | ||||
|   struct { | ||||
|     char     mi_alloc;	/* ISALLOC or ISFREE */		/* 1 */ | ||||
|     char     mi_index;	/* index in nextf[] */		/* 1 */ | ||||
|  |  | |||
|  | @ -423,7 +423,14 @@ rl_redisplay () | |||
|      contents of the command line? */ | ||||
|   while (lpos >= screenwidth) | ||||
|     { | ||||
| #if 0 | ||||
|       temp = ((newlines + 1) * screenwidth) - ((newlines == 0) ? wrap_offset : 0); | ||||
| #else | ||||
|       /* XXX - possible fix from Darin Johnson <darin@acuson.com> for prompt
 | ||||
| 	 string with invisible characters that is longer than the screen | ||||
| 	 width. */ | ||||
|       temp = ((newlines + 1) * screenwidth) + ((newlines == 0) ? wrap_offset : 0); | ||||
| #endif | ||||
|       inv_lbreaks[++newlines] = temp; | ||||
|       lpos -= screenwidth; | ||||
|     } | ||||
|  |  | |||
|  | @ -492,7 +492,7 @@ make_here_document (temp) | |||
|       len = strlen (line); | ||||
|       if (len + document_index >= document_size) | ||||
| 	{ | ||||
| 	  document_size = document_size ? 2 * (document_size + len) : 1000; | ||||
| 	  document_size = document_size ? 2 * (document_size + len) : len + 2; | ||||
| 	  document = xrealloc (document, document_size); | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										2
									
								
								shell.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								shell.c
									
										
									
									
									
								
							|  | @ -1390,9 +1390,7 @@ shell_initialize () | |||
|   char hostname[256]; | ||||
| 
 | ||||
|   /* Line buffer output for stderr and stdout. */ | ||||
| #if defined (SunOS5) | ||||
|   if (shell_initialized == 0) | ||||
| #endif | ||||
|     { | ||||
|       setlinebuf (stderr); | ||||
|       setlinebuf (stdout); | ||||
|  |  | |||
							
								
								
									
										6
									
								
								subst.c
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								subst.c
									
										
									
									
									
								
							|  | @ -5033,7 +5033,11 @@ add_string: | |||
| 	    { | ||||
| 	      if (list->next) | ||||
| 		{ | ||||
| 		  temp = string_list (quote_list (list)); | ||||
| 		  /* Testing quoted_dollar_at makes sure that "$@" is
 | ||||
| 		     split correctly when $IFS does not contain a space. */ | ||||
| 		  temp = quoted_dollar_at | ||||
| 				? string_list_dollar_at (list, Q_DOUBLE_QUOTES) | ||||
| 				: string_list (quote_list (list)); | ||||
| 		  dispose_words (list); | ||||
| 		  goto add_string; | ||||
| 		} | ||||
|  |  | |||
							
								
								
									
										5
									
								
								support/config.guess
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								support/config.guess
									
										
									
									
										vendored
									
									
								
							|  | @ -737,6 +737,11 @@ EOF | |||
|     i?86:DYNIX/ptx:4*:*) | ||||
| 	echo i386-sequent-sysv4 | ||||
| 	exit 0 ;; | ||||
| # added by chet for bash based on usenet posting from <hops@sco.com> and | ||||
| # documentation on SCO's web site -- UnixWare 7 (SVR5) | ||||
|     i?86:UnixWare:5*:*) | ||||
| 	echo ${UNAME_MACHINE}-pc-sysv5uw${UNAME_VERSION} | ||||
| 	exit 0 ;; | ||||
|     i?86:UNIX_SV:4.2MP:2.*) | ||||
| 	# Unixware is an offshoot of SVR4, but it has its own version | ||||
| 	# number series starting with 2... | ||||
|  |  | |||
							
								
								
									
										34
									
								
								support/config.sub
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										34
									
								
								support/config.sub
									
										
									
									
										vendored
									
									
								
							|  | @ -102,7 +102,7 @@ case $os in | |||
| 		os=-hiuxwe2 | ||||
| 		;; | ||||
| 	-sco5) | ||||
| 		os=sco3.2v5 | ||||
| 		os=-sco3.2v5 | ||||
| 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | ||||
| 		;; | ||||
| 	-sco4) | ||||
|  | @ -175,7 +175,8 @@ case $basic_machine in | |||
| 	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \ | ||||
| 	      | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ | ||||
| 	      | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ | ||||
| 	      | alpha-* | we32k-* | cydra-* | ns16k-* \ | ||||
| 	      | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* | alphaev6-* \ | ||||
| 	      | we32k-* | cydra-* | ns16k-* \ | ||||
| 	      | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ | ||||
| 	      | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \ | ||||
| 	      | mips64el-* | mips64orion-* | mips64orionel-* | f301-* \ | ||||
|  | @ -454,6 +455,14 @@ case $basic_machine in | |||
| 	np1) | ||||
| 		basic_machine=np1-gould | ||||
| 		;; | ||||
| 	osr5 | sco5)	# SCO Open Server | ||||
| 		basic_machine=i386-pc | ||||
| 		os=-sco3.2v5 | ||||
| 		;; | ||||
| 	odt | odt3 | odt4)	# SCO Open Desktop | ||||
| 		basic_machine=i386-pc | ||||
| 		os=-sco3.2v4 | ||||
| 		;; | ||||
| 	pa-hitachi) | ||||
| 		basic_machine=hppa1.1-hitachi | ||||
| 		os=-hiuxwe2 | ||||
|  | @ -584,6 +593,14 @@ case $basic_machine in | |||
| 		basic_machine=a29k-nyu | ||||
| 		os=-sym1 | ||||
| 		;; | ||||
| 	uw2 | unixware | unixware2) | ||||
| 		basic_machine=i386-pc | ||||
| 		os=-sysv4.2uw2.1 | ||||
| 		;; | ||||
| 	uw7 | unixware7) | ||||
| 		basic_machine=i386-pc | ||||
| 		os=-sysv5uw7 | ||||
| 		;; | ||||
| 	vaxv) | ||||
| 		basic_machine=vax-dec | ||||
| 		os=-sysv | ||||
|  | @ -683,9 +700,15 @@ case $os in | |||
| 	-solaris) | ||||
| 		os=-solaris2 | ||||
| 		;; | ||||
| 	-unixware* | svr4*) | ||||
| 	svr4*) | ||||
| 		os=-sysv4 | ||||
| 		;; | ||||
| 	-unixware | -uw | -unixware2* | -uw2*) | ||||
| 		os=-sysv4.2uw2.1 | ||||
| 		;; | ||||
| 	-unixware7* | -uw7*) | ||||
| 		os=-sysv5uw7 | ||||
| 		;; | ||||
| 	-gnu/linux*) | ||||
| 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` | ||||
| 		;; | ||||
|  | @ -759,7 +782,10 @@ case $os in | |||
| 	-sysvr4) | ||||
| 		os=-sysv4 | ||||
| 		;; | ||||
| 	# This must come after -sysvr4. | ||||
| 	-sysvr5) | ||||
| 		os=-sysv5 | ||||
| 		;; | ||||
| 	# This must come after -sysvr[45]. | ||||
| 	-sysv*) | ||||
| 		;; | ||||
| 	-xenix) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jari Aalto
				Jari Aalto