我想知道是否有人可以帮助我在bash中将ascii转换为hex.示例代码:
#!/bin/bash STR = "hello" #Convert to hex HEXVAL = $STR #(in hex here?)
我希望hexval具有值:68656C6C6F(十六进制你好)
bash hex ascii
ascii ×1
bash ×1
hex ×1