You can do that with "wc",
1. wc - l for the number of lines
2. wc -w for the number of words
Hoe should one combine these 2, let's say if I want to multiply the number of words with the number of lines from file a and b respectively?
Thanks
Printable View
You can do that with "wc",
1. wc - l for the number of lines
2. wc -w for the number of words
Hoe should one combine these 2, let's say if I want to multiply the number of words with the number of lines from file a and b respectively?
Thanks
Look into bc and dc.
For a file named e.c:
Code:echo `expr $(cat e.c|wc -l) \* $(cat e.c|wc -c)`