0

I'm attempting to get a whitespace-trimmed plain hex dump of a binary file

Command:

aes.key.hex=$(xxd -p /tmp/aes.key | tr -d '[:space:]')

Failure:

bash: aes.key.hex=097b7be16b52de77437882889fc96a27132217867970b014016f5de3e6864b37: command not found

What is happening here? I'm able to execute xxd -p /tmp/aes.key successfully, so the culprit seems like the bash command to trim all whitespaces tr -d '[:space:]'

user3613290
  • 461
  • 6
  • 18

1 Answers1

1

The periods are the problem. Use underscores instead. Variable names must be of the form [a-zA-Z_][a-zA-Z0-9_]* (regex).

wjandrea
  • 28,235
  • 9
  • 60
  • 81