Help for this page

Select Code to Download


  1. or download this
    tr ' ' '\n' < /tmp/hh | grep -c hello
    
  2. or download this
    perl -lne '$ct += s/hello//g; END {print $ct}' /tmp/hh
    
  3. or download this
    perl -0040 -ne 'END {print "$x\n"} $x++ if /hello/' /tmp/hh
    
  4. or download this
    perl -Fhello -0777 -lane 'print $#F' /tmp/hh
    
    ...
    
    # with check for word boundry (e.g. to exclude "Othello" or mispelled 
    +"cello")
    perl -apF'\bhello\b' -0777e '$_=$#F'  < /tmp/hh