![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| swap words in a line with sed | atticus | Shell Programming and Scripting | 9 | 09-13-2008 08:09 AM |
| swaping of first 2 words in every line using sed | web123 | Shell Programming and Scripting | 4 | 05-28-2008 06:02 AM |
| How to append words at the end of first line | lmatlebyane | Shell Programming and Scripting | 11 | 02-28-2008 01:39 AM |
| seperating the words from a line?? | skyineyes | Shell Programming and Scripting | 3 | 06-26-2007 06:00 AM |
| How to grep for two or more words in a line at the same time? | ElCaito | Shell Programming and Scripting | 2 | 03-01-2006 08:48 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi
i have a string like str=abc def ghi jkl now i want to count the no of words in the string please help |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
echo "abc def ghi jkl" | wc -w
Thanks Penchal |
|
#3
|
|||
|
|||
|
Quote:
str="abc def ghi jkl" echo $str|wc -w |
|
#4
|
|||
|
|||
|
satish,
I have question, are trying before posting? |
|
#5
|
|||
|
|||
|
hi elthox
it is working fine but i want to assign the count to a variable i am doing var= abc def ghi jkl mno | wc -w echo "------------------->"$var it is throwing an error please help |
|
#6
|
|||
|
|||
|
Code:
var=$(echo "abc cb fg" | wc -w) |
|
#7
|
|||
|
|||
|
hi aju
i am trying and then only i am asking i am a java resource, my project people gave me the sript to remove the queues from the cluster so i am in hurry thats why i am asking |
|||
| Google The UNIX and Linux Forums |