Added my basic hex/ascii/binary conversion scripts
This commit is contained in:
parent
e5467a1f64
commit
13066b37d7
40
README.md
40
README.md
|
@ -1,3 +1,41 @@
|
|||
# bash-utils
|
||||
|
||||
Just a couple bash utilities
|
||||
Just a couple bash utilities
|
||||
|
||||
= a2b - Convert Ascii to Binary =
|
||||
== Usage ==
|
||||
```
|
||||
a2b H e l l o
|
||||
```
|
||||
== Output ==
|
||||
```
|
||||
01001000
|
||||
01100101
|
||||
01101100
|
||||
01101100
|
||||
01101111
|
||||
```
|
||||
|
||||
= a2h - Convert Ascii to Hex =
|
||||
== Usage ==
|
||||
```
|
||||
a2h H e l l o
|
||||
```
|
||||
== Output ==
|
||||
```
|
||||
48
|
||||
65
|
||||
6c
|
||||
6c
|
||||
6f
|
||||
```
|
||||
|
||||
= h2a - Convert Hex to Ascii =
|
||||
== Usage ==
|
||||
```
|
||||
h2a 48 65 6c 6c 6f
|
||||
```
|
||||
== Output ==
|
||||
```
|
||||
H e l l o
|
||||
```
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
for c in $@; do
|
||||
echo $c | xxd -b | cut -d" " -f2
|
||||
done
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
for c in $@; do
|
||||
echo $c | xxd -p | cut -c1-2
|
||||
done
|
Loading…
Reference in New Issue