« Now that’s a one liner… | Main | Finding total number of lines in multiple files »
Yet another one line shell script :)
By Matt | October 26, 2009
grep -R ‘>1254511748.80104′ * | awk -F: ‘{print $1}’ > filename; filename=$(head -1 filename); grep -n ‘%idle’ $filename | awk -F: ‘{print $1 + 13}’ > linenum; sed -i ‘s/^/head -/g’ linenum; sedfilename=$(head -1 filename | sed ‘s/\//\\\//g’); sed -i “s/$/ $sedfilename | tail -1 /g” linenum; chmod 755 linenum; ./linenum | sed ‘s/^.*”>//g’ | sed ‘s/<.*$//g’ | awk ‘{print 100 – $1}’
Topics: Uncategorized | No Comments »
Comments
You must be logged in to post a comment.