Re: Readline fencepost error with long prompt
Chet Ramey writes: > Try the attached patch. It should fix the problem without introducing any > regressions. Looks good, I couldn't find any regressions. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Testing standard output and exit statuses from commands in a pipe
Hello! I'd like to pipe the output from a command, say A, to another command, say B, then check if both commands completed successfully (i.e.with exist status 0) and, if so, compare the standard output from command B to some string. How can I do this in a bash script? Regards, Angel Tsankov
Re: Testing standard output and exit statuses from commands in a pipe
On Mon, Apr 27, 2009 at 05:02:26PM +0300, Angel Tsankov wrote: > I'd like to pipe the output from a command, say A, to another command, say > B, then check if both commands completed successfully (i.e.with exist status > 0) PIPESTATUS An array variable (see Arrays below) containing a list of exit status values from the processes in the most-recently-executed foreground pipeline (which may contain only a single command). > and, if so, compare the standard output from command B to some string. > How can I do this in a bash script? Ah, that makes it much trickier. You can't use PIPESTATUS when you're capturing the output of a pipeline with a command substitution. arc1:~$ x() { echo x; exit 1; } arc1:~$ y() { echo y; exit 0; } arc1:~$ x|y; echo "${pipestat...@]}" y 1 0 arc1:~$ q=$(x|y); echo "${pipestat...@]}" 0 In this case, you will need either a temporary file, or a named pipe.
bug: variables.c does not compile ...
... after having configured bash-3.2.48 with "--disable-debugger": --- *** --- * * --- * GNU bash, version 3.2.48(3)-release (i386-pc-linux-gnu) --- * * --- *** --- ---rm -f variables.o ---gcc -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"i386"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"i386-pc-linux-gnu"' -DCONF_VENDOR='"pc"' -DLOCALEDIR='"/usr/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -O2 -momit-leaf-frame-pointer -c variables.c ---variables.c: In function `find_function_def': ---variables.c:1578: error: `shell_function_defs' undeclared (first use in this function) ---variables.c:1578: error: (Each undeclared identifier is reported only once ---variables.c:1578: error: for each function it appears in.) ---variables.c: In function `bind_function_def': ---variables.c:2145: error: `shell_function_defs' undeclared (first use in this function) ---variables.c: In function `unbind_function_def': ---variables.c:2354: error: `shell_function_defs' undeclared (first use in this function) ---make: *** [variables.o] Error 1 The following patch makes it work: --- variables.c.orig2009-04-27 17:19:59.0 +0200 +++ variables.c 2009-04-27 17:21:00.0 +0200 @@ -109,11 +109,9 @@ the environment. */ HASH_TABLE *shell_functions = (HASH_TABLE *)NULL; -#if defined (DEBUGGER) /* The table of shell function definitions that the user defined or that came from the environment. */ HASH_TABLE *shell_function_defs = (HASH_TABLE *)NULL; -#endif /* The current variable context. This is really a count of how deep into executing functions we are. */ regards horst wente
Script to Convert HTML to MIME mail -- HELP!
Hi: I have writed a script that read a HTML file and convert this in a multipart mime for send in a mail. But the result isn't interpreted like a mime file!! Somebody can see the error??? This is an example of an output of the script: http://pastebin.com/m5a5e6a37 This is an example of an output of the same example but edited and sended with thunderbird: http://pastebin.com/m775c0396 This is the script: http://pastebin.com/m706c6984 -- View this message in context: http://www.nabble.com/Script-to-Convert-HTML-to-MIME-mailHELP%21-tp23262608p23262608.html Sent from the Gnu - Bash mailing list archive at Nabble.com.