Bug #24605 | mysql_secure_installation uses unsupported option for echo | ||
---|---|---|---|
Submitted: | 26 Nov 2006 22:36 | Modified: | 25 Jan 2007 20:40 |
Reporter: | Daniël van Eeden | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Installing | Severity: | S3 (Non-critical) |
Version: | 5.0.27 | OS: | Solaris (Solaris 10) |
Assigned to: | Kent Boortz | CPU Architecture: | Any |
[26 Nov 2006 22:36]
Daniël van Eeden
[27 Nov 2006 10:30]
Hartmut Holzgraefe
See the "Writing portable Bourne Shell -> Utilities" in the "GNU Autoconf, Automake and Libtool" book for a possible solution to this: http://sourceware.org/autobook/autobook/autobook_220.html#SEC220 The echo command has at least two flavors: the one takes a `-n' option to suppress the automatic newline at the end of the echoed string; the other uses an embedded `\c' notation as the last character in the echoed string for the same purpose. If you need to emit a string without a trailing newline character, you can use the following script fragment to discover which flavor of echo you are using: case echo "testing\c"`,`echo -n testing` in *c*,-n*) echo_n= echo_c='(53) ' ;; *c*,*) echo_n=-n echo_c= ;; *) echo_n= echo_c='\c ;; esac Any echo command after the shell fragment above, which shouldn't move the cursor to a new line, can now be written like so: echo $echo_n "prompt:$echo_c"
[1 Jan 2007 4:30]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/17492 ChangeSet@1.2585, 2007-01-01 05:30:31+01:00, kent@mysql.com +2 -0 mysql_secure_installation.sh: Portable handling of "echo" without newline (bug#24605) check-cpu: In developer script safe to use "printf", not "echo -n"
[2 Jan 2007 10:01]
Joerg Bruehe
Ok to push, more comments in separate mail.
[25 Jan 2007 19:05]
Joerg Bruehe
The patch was pushed into 5.1.15 on Jan 11 already :-( It is in 5.0.34 and will be in 4.1.23.
[25 Jan 2007 20:40]
Paul DuBois
No changelog entry needed.