Tíquete #43146

built-in printf doesn't expand hex sequences

: 2021-10-29 08:18 Última Atualização: 2021-10-30 01:18

Relator:
(Anônimo)
Dono:
Estado:
Aberto [Owner assigned]
Componente:
Marcos:
(Nenhum)
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Nenhum
Arquivo:
Nenhum
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

yash:

$ printf "\x66\x65\n"
\x66\x65

busybox sh and bash:

$ printf "\x66\x65\n"
fe

this is somewhat of a bummer as now i can't pass anything outside ascii space as commandline parameters to apps (as yash doesn't implement echo -ne either)

Ticket History (3/4 Histories)

2021-10-29 08:18 Updated by: None
  • New Ticket "built-in printf doesn't expand hex sequences" created
2021-10-29 21:41 Updated by: magicant
  • Details Updated
2021-10-29 21:59 Updated by: magicant
  • Tipo Update from Bugs to Feature Requests
Comentário

Why not use the portable octal escapes?

$ printf "\146\145\n"
fe

Yash does support echo -ne too. Maybe you forgot to enable it.

$ ECHO_STYLE=GNU
$ echo -ne '\0146\0145\n'
fe
2021-10-30 01:18 Updated by: None
Comentário

Why not use the portable octal escapes?

because that'd require converting all hex stuff (e.g. taken from hexeditor) first into octal, and rewriting a lot of stuff like https://github.com/sabotage-linux/sabotage/blob/master/KEEP/alarmclock ...

ECHO_STYLE=GNU

ah thanks, good to know. still, no hex :/

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login