Bug#649515: [9a19418] Fix committed to git
On 02.06.2012 14:50, Mario 'BitKoenig' Holbe wrote: > This would, btw., also enable the script to use plain /bin/sh rather > than depending on bash. As far as I can tell, there is nothing specific to bash about this. Compare sections 2.9.3 and 2.9.4 of the "Shell and Utilities" part of the POSIX.1-2008 standard. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html Both || and { …; } are defined there, so any POSIX shell should work. But that doesn't change the fact that the syntax you propose would be easier to read and maintain. Greetings, Martin signature.asc Description: OpenPGP digital signature
Bug#649515: [9a19418] Fix committed to git
package smartmontools reopen 649515 severity important thanks On Sat, May 12, 2012 at 06:35:45PM +0200, Martin von Gagern wrote: > On 12.05.2012 12:57, Giuseppe Iuculano wrote: > > You can check the diff of the fix at: > > > > > > http://git.debian.org/?p=collab-maint/smartmontools.git;a=commitdiff;h=9a19418 > The fix is incorrect for two reasons. > bash requires the space after the opening curly brace, otherwise it will ... > bash also requires a final semicolon to end the list of commands. That Reopening the bug due to this. Raising the bug's severity since smartd now is not sending mails anymore at all. Here is what smartd syslog()s to daemon.log: /etc/smartmontools/run.d/10mail: /etc/smartmontools/run.d/10mail: line 4: exit: 1}: numeric argument required run-parts: /etc/smartmontools/run.d/10mail exited with return code 255 Warning via /usr/share/smartmontools/smartd-runner to smart: failed (32-bit/8-bit exit status: 256/1) I personally would like to suggest using a "classic" if ! [ -x /usr/bin/mail ]; then ... fi syntax to avoid and prevent such mistakes by less experienced users/maintainers in the future, too. This would, btw., also enable the script to use plain /bin/sh rather than depending on bash. Thanks for your work & regards Mario -- Programmieren in C++ haelt die grauen Zellen am Leben. Es schaerft alle fuenf Sinne: den Schwachsinn, den Bloedsinn, den Wahnsinn, den Unsinn und den Stumpfsinn. [Holger Veit in doc] signature.asc Description: Digital signature
Bug#649515: [9a19418] Fix committed to git
On 12.05.2012 12:57, Giuseppe Iuculano wrote: > You can check the diff of the fix at: > > > http://git.debian.org/?p=collab-maint/smartmontools.git;a=commitdiff;h=9a19418 The fix is incorrect for two reasons. bash requires the space after the opening curly brace, otherwise it will consider it a word for brace expansion instead of the beginning of a command list. This isn't perfectly clear from the bash docs, but a simple example on the command line will clearly exhibit that problem. bash also requires a final semicolon to end the list of commands. That fact has been explicitely stated in bash docs. A space after that appears to be optional, but for reasons of symmetry I'd add one as well. I suggest you improve the fix accordingly. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org