Skip to content

Instantly share code, notes, and snippets.

@Tony3-sec
Created January 11, 2016 10:53
Show Gist options
  • Select an option

  • Save Tony3-sec/76c8d1751d19c3ab8cff to your computer and use it in GitHub Desktop.

Select an option

Save Tony3-sec/76c8d1751d19c3ab8cff to your computer and use it in GitHub Desktop.
#!/bin/bash
## Convert hex to decimal
if [ $# -ne 1 ]; then
echo "Usage: $0 [hex data]"
exit 1
fi
head=0x
data=$1
hex=$head$data
echo $(($hex))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment