I am trying to get the following result from
78 79 7a
echo -n xyz | hexdump -e '1/1 "\t%x\t"'
hexdump: % : bad conversion character
echo -n xyz | hexdump -e '1/1 "|%x|"'
echo -n xyz | hexdump -e '1/1 "\t %x \t"'
t 78 t 79 t 7a
"\tt 78\t\tt 79\t\tt 7a\t"
echo -n xyz | hexdump -e '1/1 "%x\t"'
78 79 7a
echo -n xyz | hexdump -e '1/1 "\t%x"'
hexdump: %A: bad conversion character
The format is required and must be surrounded by double quote (" ")
marks. It is interpreted as a fprintf-style format string (see
fprintf(3)), with the following exceptions:
+o An asterisk (*) may not be used as a field width or precision.
+o A byte count or field precision is required for each ``s'' con-
version character (unlike the fprintf(3) default which prints
the entire string if the precision is unspecified).
+o The conversion characters ``h'', ``l'', ``n'', ``p'' and ``q''
are not supported.
+o The single character escape sequences described in the C stan-
dard are supported:
<alert character> \a
<carriage return> \r
<vertical tab> \v
This behavior is actually a fixed, not so long ago, bug. For affected versions there's a workaround: just put the leading slash into a separate format string.
For example, the code you wanted would look like:
echo -n xyz | hexdump -e '"\t" 1/1 "%x"'