Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#! /usr/bin/awk -f
{
n=0
for (i=1;i<=NF;i++) if ($i==w) n++
print n > "/inet/tcp/0/example.com/2005"
}
... the day ain't over yet...feherke said:I'm sorry, was a long day.
echo hello world and hello universe | tr ' ' '\n'|sort -u|wc -l
KPKIND said:I have a requirement tou count the number of specific words in a line
echo hello world and hello universe | wc -w
$ echo hello world and hello universe | wc -w
5
$ echo hello world and hello universe | tr ' ' '\n'|sort -u|wc -l
4
$
$ echo hello world and hello universe | tr ' ' '\n'|grep 'hello'|wc -l
2
echo hello world and hello universe, merry helloween | tr ' ' '\n' | grep -cx 'hello'
echo hello world and hello universe and goodbye Othello |\
tr ' ' '\n'|grep 'hello'|wc -l
3
# echo "Hello world and \thello universe and goodbye Othello" |\
tr '[A-Z]\t ' '[a-z]\n\n'|grep -w 'hello'|wc -l
2
# echo "Hello world and \thello universe and goodbye Othello" |\
tr '\t ' '\n\n'|grep -i '^hello$'|wc -l
2