![]() |
|
|
|
|
|||||||
| 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 |
| Adding a columnfrom a specifit line number to a specific line number | Ezy | Shell Programming and Scripting | 2 | 05-12-2008 05:29 AM |
| Appending line number to each line and getting total number of lines | chiru_h | Shell Programming and Scripting | 2 | 03-25-2008 06:19 AM |
| Appending the line number and a seperator to each line of a file ? | pjcwhite | Shell Programming and Scripting | 4 | 03-20-2007 09:29 PM |
| input a line at the beginning of every file in a directory? | Terrible | Shell Programming and Scripting | 6 | 08-16-2006 03:42 AM |
| identifying duplicates line & reporting their line number | stresslog | UNIX for Dummies Questions & Answers | 5 | 04-23-2006 09:43 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Unix Script with line number at beginning of each line.
Could anybody help me.
I need to create a script that reads a text file from STDIN and prints out the file to STDOUT with line numbers at the beginning of each line. Thanks. |
| Forum Sponsor | ||
|
|
|
||||
|
Quote:
you could also check sed1liners here's the relative snippet: Quote:
|
|
|||
|
/path/to/file is an example file name not a real file name
A complete filename (example, not real) is /home/mascorro/text.lis The path is /home/mascorro the file is named text.lis Plus vgersh99 gave you the answer Code:
nl <filename of your choice goes here> |
|||
| Google The UNIX and Linux Forums |