![]() |
|
|
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 |
| total number of lines in a file | Raynon | Shell Programming and Scripting | 9 | 10-04-2007 10:13 AM |
| grep running total/ final total across multiple files | MrAd | UNIX for Dummies Questions & Answers | 5 | 05-08-2007 02:03 PM |
| total in ls -l command | shriashishpatil | UNIX for Advanced & Expert Users | 11 | 04-05-2007 03:13 PM |
| total number of lines | mahabunta | Shell Programming and Scripting | 4 | 01-31-2007 05:11 AM |
| Total of lines w/out header and footer incude for a file | gzs553 | Shell Programming and Scripting | 1 | 11-16-2006 07:42 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
sed command to get the total lines
hi,
I am using the following code to get the first field of all the lines in a file using sed command.But its not printing the last line.Why it is so and how can i read the different fields of each line ? code: for i in $(sed = filename.txt | sed 'N;s/\n/ /' | cut -d " " -f1) do val1=`sed -n "${i},${i}p" filename.txt | cut -d " " -f1` echo "$val1" done |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|