I have a command which is very handy at work. It searches for a certain STRING inside some hex raw files with FILENAME. The command which I always used in Linux systems is:  find . -name '**FILENAME**' | while read filename; do     xxd -p $filename | tr -d '\n' | grep -i **STRING** > /dev/null    if [ $? -eq 0 ];then         echo STRING FOUND IN $filename;     fi; doneI did not build this command. On HP-UX systems, as xxd is not present, I would need to use xd. But I do not know how to get the same results as with xxd -p.How could I adapt this command to run on HP-UX systems?
xxd -p alternative for HP-UX - how to get the same results with xd?
hp ux;xxd
I'm not on HP-UX, so this has only been checked against xd(1):xd -b -An -v $filename-An prevents the offset from being shown-b defaults to single bytes, (octal for od, hex for xd)-v prevents identical lines from being replaced with *(A lot of systems, mine included, have od but not xd.  So for portability, I use od -tx1 -An -v $filename instead.)That will output individual hex bytes, with a space between each.  Changing the tr command to tr -d [:space:] will remove all whitespace, not just newlines.Joining that all together, you need to replace the xxd and tr parts of your script so that the line looks like this:xd -b -An -v $filename | tr -d '[:space:]' | grep -i **STRING** > /dev/null