![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | 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 |
| Perl onliner to search the last line with an occurence of a pattern | ammu | Shell Programming and Scripting | 4 | 01-30-2008 09:09 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
help with onliner
Hi
I want to insert a line after a line by searching for the last occurence for that. I have taken an already posted example. Say in the following file a.txt ------ adadfadafadf adfadadf cool dfadfadfadfara adfadfadf cool aaaaaaaaaaaaaa hai how are you I want to insert after the red line. With unix sed command we can do it, but i think it needs an temp file. Using Perl we can do it with out using temp file. Perl onliner perl -i -ne 'print ..................' file name will help. Can some give me the exact command Thanks in advance Lijju Math |
| Forum Sponsor | ||
|
|