How do I pass hex characters to printf in a script command?
0
votes
1
answer
439
views
How do I get printf to output hex characters when run from a script?
Suppose I am at the prompt and type **printf "\x41\x42"** the output I get
AB%
However if I have a script containing that line i.e.
cat test.sh
produces
printf "\x41\x42"
But executing the script **./test.sh** produces
\x41\x42%
How do I get the script to produce the same results as from the shell prompt?
Asked by sgmoore
(125 rep)
Apr 22, 2024, 11:04 AM
Last activity: Apr 22, 2024, 11:37 AM
Last activity: Apr 22, 2024, 11:37 AM