Skip to content

Instantly share code, notes, and snippets.

@mazgi
Created July 24, 2012 08:32
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 mazgi/3168836 to your computer and use it in GitHub Desktop.
Save mazgi/3168836 to your computer and use it in GitHub Desktop.
zshでログ抽出してみる
$ zcat dir/orig.gz | while read line
do
r=
echo $line
vared -p "write?(Y/n)" r
if [ -z "${r}" -o "${r}" = 'y' -o "${r}" = 'Y' ]; then
echo $line >> /tmp/extracted.log
echo "writed."
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment