g 330 B

12345678910111213141516
  1. #!/bin/rc
  2. if(~ $#* 0 1){
  3. what=$1
  4. if(~ $#what 0)
  5. what=`{cat}
  6. files=()
  7. for(f in *){
  8. if(file -m $"f | grep -s text/ )
  9. files=($files $"f)
  10. }
  11. if(! ~ $#files 0)
  12. grep -n -- $what $files /dev/null
  13. }
  14. if not grep -n $* /dev/null