I’m trying to convert “Hello” to 48 65 6c 6c 6f in hexadecimal as efficiently as possible using the command line.
I’ve tried looking at printf and google, but I can’t get anywhere.
Any help greatly appreciated.
Many thanks in advance,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Explanation:
echoprogram will provide the string to the next command.-nflag tells echo to not generate a new line at the end of the "Hello".odprogram is the "octal dump" program. (We will be providing a flag to tell it to dump it in hexadecimal instead of octal.)-A nflag is short for--address-radix=n, with n being short for "none". Without this part, the command would output an ugly numerical address prefix on the left side. This is useful for large dumps, but for a short string it is unnecessary.-t x1flag is short for--format=x1, with the x being short for "hexadecimal" and the 1 meaning 1 byte.Further details on ExplainShell.com: https://explainshell.com/explain?cmd=echo+-n+%22Hello%22+%7C+od+-A+n+-t+x1