![]() |
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 |
| How to export | jisha | BSD | 4 | 01-21-2008 07:06 AM |
| combining fields in two text fields | shocker | Shell Programming and Scripting | 3 | 01-16-2008 11:27 AM |
| export??? | Justinkase | Shell Programming and Scripting | 1 | 12-03-2007 06:32 PM |
| difference between set and export | shriashishpatil | UNIX for Dummies Questions & Answers | 1 | 02-22-2006 01:28 PM |
| export variables | srishan | Shell Programming and Scripting | 4 | 07-06-2004 01:53 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
export only last two fields?
export only last two fields?
here is my test file, with variable length of fields, each line is composed of letter only, and each line has at least 2 fields, fields were separated by dot (.) abcd.abc.mlm dft.dfasdf.bmk.kdjlka ksdfalksdjfsl.tyu.ml kasdjf.asdfkja.asdfj.asdf.df.m lja.ml aslkjdfjasldkf.sadlfkasdjlf.sdfasdfsa.asdfasdf.fdlm I am trying to use sed to parse the test file, and only display the last two fields, like abc.mlm bmk.kdjlka tyu.ml df.m At first my idea was something like ++ sed 's/!\.[a-z][a-z]*\.[a-z][a-z]*$/&/' test ++, and sure it did not work. Any help? thank you! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|