![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Need help capturing end of line numbers | icalderus | SUN Solaris | 3 | 09-21-2007 02:34 AM |
| generating random numbers with hamming distance 4 | hack_tom | Shell Programming and Scripting | 2 | 04-29-2007 01:27 AM |
| add line numbers | esham | Shell Programming and Scripting | 4 | 03-07-2005 10:46 AM |
| Printing line numbers | MizzGail | UNIX for Dummies Questions & Answers | 2 | 07-25-2002 04:18 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Code:
cat -n "$file" | sed -e 's/^ *[1-9][0-9]*/&)/' Actually this is probably easier in awk. Code:
awk '{ print NR ") " $0 }' "$file"
Last edited by era; 04-28-2008 at 05:20 PM.. Reason: awk too |
|
||||
|
any other way without the sed and awk plssss
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|