Skip to content
Snippets Groups Projects

here texts

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Luxing Huang
    count.sh 276 B
    #!/bin/sh
    
    total=0
    textfile=0
    
    while read line
    do
        export total=`expr $total + 1`
        if [ "`printf "$line" | grep text`" != "" ]
        then
            export textfile=`expr $textfile + 1`
            echo "$textfile"
        fi
    done <<< "$(find . -type f)"
    
    echo $total
    echo $textfile
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment