Skip to content

Instantly share code, notes, and snippets.

@iegik
Created February 12, 2020 14:35
Show Gist options
  • Save iegik/ed926df1a8d15e421a58e6cc692213d7 to your computer and use it in GitHub Desktop.
Save iegik/ed926df1a8d15e421a58e6cc692213d7 to your computer and use it in GitHub Desktop.
Bash search script
#!/bin/bash
# grep -sinE $1 --color -R ./* > $2; wc -l $2;
TEXT=$1
FILE=$2
grep -sinE $TEXT -R ./* | awk -F":" '{ print "name: "$1"\nline: "$2"\ncontent "$3"\ninfo: \""; system("stat -nf\"%z, %B %m\" "$1); print "\"\n"}' > $FILE;
grep "name: " $FILE | wc -l;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment