I'm trying to run a script and I need hexdump.
Can someone help me/give me tips?
opkg find *hex*
mcookie - 2.34-1 - mcookie generates a 128-bit random hexadecimal number for use with the X
authority system
xxd - 8.1-4 - xxd creates a hex dump of a given file or standard input, it can also convert
a hex dump back to its original binary form.
opkg install xxd
Installing xxd (8.1-4) to root...
Downloading http://bin.entware.net/aarch64-k3.10/xxd_8.1-4_aarch64-3.10.ipk
Configuring xxd.
echo abcd | xxd
00000000: 6162 6364 0a abcd.
Code:opkg find *hex* mcookie - 2.34-1 - mcookie generates a 128-bit random hexadecimal number for use with the X authority system xxd - 8.1-4 - xxd creates a hex dump of a given file or standard input, it can also convert a hex dump back to its original binary form. opkg install xxd Installing xxd (8.1-4) to root... Downloading http://bin.entware.net/aarch64-k3.10/xxd_8.1-4_aarch64-3.10.ipk Configuring xxd. echo abcd | xxd 00000000: 6162 6364 0a abcd.
roberto@A:/tmp/home/root# opkg install xxd
Installing xxd (8.1-4) to root...
Downloading http://bin.entware.net/aarch64-k3.10/xxd_8.1-4_aarch64-3.10.ipk
Configuring xxd.
roberto@A:/tmp/home/root# echo abcd | xxd
00000000: 6162 6364 0a abcd.
roberto@A:/tmp/home/root# echo $(dd bs=1 count=21 if=/dev/urandom 2>/dev/null)|hexdump -v -e '/1 "%02X"'|sed -e s/"0A$"//g
-sh: hexdump: not found
roberto@A:/tmp/home/root# echo $(dd bs=1 count=21 if=/dev/urandom 2>/dev/null)|xxd -v -e '/1 "%02X"'|sed -e s/"0A$"//g
xxd V1.10 27oct98 by Juergen Weigert
I'm still a newbie, still having issues;
I installed and tested xxd;
Code:roberto@A:/tmp/home/root# opkg install xxd Installing xxd (8.1-4) to root... Downloading http://bin.entware.net/aarch64-k3.10/xxd_8.1-4_aarch64-3.10.ipk Configuring xxd. roberto@A:/tmp/home/root# echo abcd | xxd 00000000: 6162 6364 0a abcd.
part of the script I'm trying to run:
I replaced hexdump witd xxd (maybe it helps but I think it's not):Code:roberto@A:/tmp/home/root# echo $(dd bs=1 count=21 if=/dev/urandom 2>/dev/null)|hexdump -v -e '/1 "%02X"'|sed -e s/0A$//g -sh: hexdump: not found
Code:roberto@A:/tmp/home/root# echo $(dd bs=1 count=21 if=/dev/urandom 2>/dev/null)|xxd -v -e '/1 "%02X"'|sed -e s/"0A$"//g xxd V1.10 27oct98 by Juergen Weigert
hexdump -v -e '/1 "%02X"'
echo $(dd bs=1 count=21 if=/dev/urandom 2>/dev/null) | xxd -u -ps | sed 's/0A$//'
head -c 21 /dev/urandom | xxd -u -ps
# opkg install busybox
Installing another version of BusyBox from Entware is generally not recommended as it can create incompatibilities with the installed Asus version.Sorry to resurrect such an old thread, but I figured since I came to this thread looking for the same answer, then others might too.
I found that Entware's version of busybox has hexdump in it. So those looking for hexdump for a script (some configure scripts use it) can simply:
Code:# opkg install busybox
Anything that the Asus scripts are running shouldn't know about or touch binaries in /opt unless since the path they run under won't even include /opt/bin. So it should be pretty safe.Installing another version of BusyBox from Entware is generally not recommended as it can create incompatibilities with the installed Asus version.
for FILE in `find /opt/bin -lname /opt/bin/busybox`; do rm $FILE; done
ln -s /opt/bin/busybox /opt/bin/hexdump
/bin/busybox
/opt/bin/busybox
We've had problems with this before. It's not so much Asus' code but third party scripts. /opt/sbin and /opt/bin are included in the default path (even when Entware isn't installed). In a non-interactive environment they're placed at the end of the path but for interactive sessions (or scripts that invoke the Entware profile) they're moved to the front of the path.Anything that the Asus scripts are running shouldn't know about or touch binaries in /opt unless since the path they run under won't even include /opt/bin. So it should be pretty safe.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!