-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 6/30/2009 12:07 AM:
> Thinking about it again, my patch was too lax and should have been
> stricter: within a command substitution, the \c causes all but the
> first character of the output to be removed.  Let's test for that,
> just like Jan suggested, but just not set ECHO_C at all in this
> case, and set ECHO_T to a tab like is done in the other bailout
> case.
> 
> Thus I suggest this patch.  OK?

Yes, once these nits are fixed:

> +...@samp{n}.  Within a command substitution, @samp{echo 'string\c'} will
> +mess up the internal state of ksh88 on AIX 6.1 so that it will print
> +the first character @samp{c} only, followed by a newline, and then

s/{c}/{s}/

> +entirely drop the output of the next echo in a command substitution.

Would it be worth an @example showing this weird behavior, or do you think
the paragraph was sufficient?  I could go either way.

>  [ECHO_C= ECHO_N= ECHO_T=
>  case `echo -n x` in @%:@((((

You added a ), so this comment should add a (.

>  -n*)
> -  case `echo 'x\c'` in
> +  case `echo 'xy\c'` in
>    *c*) ECHO_T='      ';;     # ECHO_T is single tab character.
> -  *)   ECHO_C='\c';;
> +  xy*) ECHO_C='\c';;

I'd rather use exactly 'xy)', since the whole point of \c was that no
other characters appeared.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpJ/V8ACgkQ84KuGfSFAYCRpACgvbtu9fzuSvjsVX1LKJzz5NFm
xocAnj7WJz+L5aX3yi6OgSbHYQ352V/D
=0CoO
-----END PGP SIGNATURE-----


Reply via email to