![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Count number of occurences of a word | shikhakaul | UNIX for Dummies Questions & Answers | 8 | 06-25-2009 11:10 AM |
| How to find a count of a word within a file | bd_joy | Shell Programming and Scripting | 9 | 07-14-2008 09:29 AM |
| grep all records in a file and get a word count -perl | meghana | Shell Programming and Scripting | 4 | 02-13-2008 10:06 PM |
| search& count for the occurence of a word | skoppana | UNIX for Dummies Questions & Answers | 1 | 11-09-2007 05:07 PM |
| word count showing wrong number of lines | tselvanin | UNIX for Dummies Questions & Answers | 3 | 01-06-2004 11:33 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
|
|
|||||
|
Quote:
Code:
$echo compoundwordinmiddle >inputfile $count1=`wc -w inputfile` $count2=`sed s/word/" "/g inputfile |wc -w` $echo $count1 1 inputfile $echo $count2 2 |
|
||||
|
yes you are right but if not this code is very simple
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|