Last active
August 26, 2016 02:22
-
-
Save MLKrisJohnson/485d17e4bef7a339365c4d6a9d9b75ec to your computer and use it in GitHub Desktop.
Bash/zsh functions for converting command-line arguments between decimal and hex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d2x() { | |
printf "%x\\n" $1 | |
} | |
x2d() { | |
echo $((16#$1)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage: