This is a discussion on Script to display number of lines and words from a file within the Shell scripting forums, part of the Development/Scripting category; Hi, I need some help on scripting. I am doing a simple echo of lines and words from a file ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
Hi,
I need some help on scripting. I am doing a simple echo of lines and words from a file and I also want to echo the number of lines and words to it. Where can I get this help A simple script I am using is for i in `cat hostfile` do echo $i done And what I would like to do is something like this: for i in `cat hostfile` do for j in ((j=1;j<=1000;j++)) do echo $i echo $j done Thanks a lot in advance |
| Sponsored Links | ||
|
|
|
|||
|
Thanks Man
This definetly makes sense. However this the scenerio. Let say I have install 100 patches to a system (Sun Machine). And I am using patchadd command , so I would like to see the output of the patchadd command as well as the number of patches it has installed. In other words count per line with the command so the out put might look like this: 1 patch "xxxx001" has been installed 2 patch "xxxx002" has been installed . . . . 100 patch "xxx100" has been installed so in other words not just echo of line but some command as well Sincere apologies if I look like a fool but .... |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Display number of processors on linux | tom | Getting started tutorials | 7 | 08-12-2008 11:51 AM |
| How to print some lines from a file | Prahlad | Shell scripting | 3 | 04-24-2008 12:25 AM |
| UNIX Display or list number of files in a current directory | raj | Getting started tutorials | 1 | 12-07-2007 11:55 AM |
| Calculations across different lines & columns of a file | Guest | Shell scripting | 2 | 09-16-2005 05:18 AM |
| searching for bad words script | marinm | Shell scripting | 1 | 02-03-2005 05:32 PM |