In bash, how can I convert an hex-encoded string like this:
2e2f65202d6b2022616622
or
\x2e\x2f\x65\x20\x2d\x6b\x20\x22\x61\x66\x22
(or something similiar) to:
./e -k "af"
... and then execute it?
Thanks!
In bash, how can I convert an hex-encoded string like this:
2e2f65202d6b2022616622
or
\x2e\x2f\x65\x20\x2d\x6b\x20\x22\x61\x66\x22
(or something similiar) to:
./e -k "af"
... and then execute it?
Thanks!
The most appropriate way I can think of to do this would be through a function.
For example:
exec_hex_str() {
cmd_val=$(printf "$1")
echo "Executing: $cmd_val"
eval $cmd_val
}