Created
December 23, 2018 10:06
-
-
Save gitnepal/bb525637f3433239453b58de89e5fc23 to your computer and use it in GitHub Desktop.
Encoding Strings to charcode | Bash scripts
This file contains hidden or 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
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Enter Text" | |
exit 1 | |
fi | |
#Run script as | |
#./asciigen.sh texthere | awk {'print $6'} | tr "\n" " " | |
#Usage if you want numbers only | |
foo=$1 | |
for (( i=0; i<${#foo}; i++ )); | |
do | |
bar=$(echo ${foo:$i:1}) | |
raw=$(ascii $bar) | |
final=$(echo $raw | grep "prints" | awk {'print $5'} | tr -d ',' ) | |
echo "ASCII value of $bar is $final" | |
done | |
#Encoding strings to charcode | |
#//rootnep.al /@__0x00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment