bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

${var@P} expansion includes 0x01 and 0x02


From: Greg Wooledge
Subject: ${var@P} expansion includes 0x01 and 0x02
Date: Tue, 27 Oct 2015 17:02:41 -0400
User-agent: Mutt/1.4.2.3i

I decided to play around with the ${var@P} expansion in 4.4-beta.

imadev:~$ red=$(tput setaf 1) reset=$(tput sgr0) 
x='\[$red\]\u\[$reset\]@\h:\w\$ '; printf %s "${x@P}" | od -t x1
0000000    1  1b  5b  33  31  6d   2  77  6f  6f  6c  65  64  67   1  1b
0000020   5b  6d   f   2  40  69  6d  61  64  65  76  3a  7e  24  20
0000037

I don't think the "1" and "2" bytes should be printed.  They're for
internal use only, even if they're usually invisible.

imadev:~$ printf %s "$red" | od -t x1
0000000   1b  5b  33  31  6d
0000005
imadev:~$ printf %s "$reset" | od -t x1
0000000   1b  5b  6d   f
0000004



reply via email to

[Prev in Thread] Current Thread [Next in Thread]