was wondering if anyone could help me with converting ascii to hex in bash.
Example code:
#!/bin/bash
STR = "hello"
#Convert to hex
HEXVAL = $STR #(in hex here?)
I want hexval to have the value:
68656C6C6F (hello in hex)
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.
Or:
Careful with the
'"%X"'; it has both single quotes and double quotes.