Skip to content

Instantly share code, notes, and snippets.

@katsusuke
Forked from dot/nfd_d.sh
Created October 2, 2020 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katsusuke/6d51fb21f4760b98074fd7e696952686 to your computer and use it in GitHub Desktop.
Save katsusuke/6d51fb21f4760b98074fd7e696952686 to your computer and use it in GitHub Desktop.
detect NDF file
#!/bin/sh
dir=$1
if [ ! -d "$dir" ]; then
dir='.'
fi
find "$dir" -name '*[! -~]*' | while read file
do
bstr=`basename "$file" | xxd -g1`
if [ "`echo $bstr | grep 'e3 82 9a'`" ] || [ "`echo $bstr | grep 'e3 82 99'`" ] ; then
echo $file
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment