Skip to content

Instantly share code, notes, and snippets.

@uzzu
Created October 4, 2012 10:26
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 uzzu/3832770 to your computer and use it in GitHub Desktop.
Save uzzu/3832770 to your computer and use it in GitHub Desktop.
ファイル中のASCII文字以外の文字を消す ref: http://qiita.com/items/fd0b89955d18fb21a3ae
#!/bin/sh
usage() {
echo Usage: $0 [OPTIONS] DIRECTORY FILEPATTERN
echo;
echo "\t\tOPTIONS equivalent to OPTIONS of sed"
}
case "$#" in
2) find $1 -name $2 | xargs sed -e 's/[^\x00-\x7E]//g' | less;;
3) find $2 -name $3 | xargs sed $1 's/[^\x00-\x7E]//g';;
*) usage;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment