Skip to content

Instantly share code, notes, and snippets.

@rajeshpv
Created July 21, 2010 20:34
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 rajeshpv/485080 to your computer and use it in GitHub Desktop.
Save rajeshpv/485080 to your computer and use it in GitHub Desktop.
#!/bin/bash
logDir=~/work/logs
#find $logDir -type f -name '*.log' | xargs echo $1
shopt -s nullglob
for f in $(find $logDir -type f -name '*.log')
do
echo $f
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" $f > ${logDir}/temp.txt
cp ${logDir}/temp.txt $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment