Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Apr 14th, 2009, 8:42 AM   #1
centurion555
Newbie
 
Join Date: Nov 2008
Posts: 9
Rep Power: 0 centurion555 is on a distinguished road
adjacent lines with same beginning character.

Dear All,

I have been looking for a script/command that look for two adjacent lines lines starting with same letter/character. For example, my file looks like:

*********************************delete duplicates***************
# rm -rvf /home/centurion/Newfolder/donotdelte.txt
# rm rvf /home/centurion/dontdelete.txt

rm -rvf /home/centurion/Newfolder/trial.txt
rm -rvf /home/centurion/trial.txt

rm -rvf /home/centurion/Newfolder/deltethisfile.txt
# rm rvf /home/centurion/dontdelete0.txt
# rm rvf /home/centurion/dontdelete1.txt

**********************************************************************
and I want to see all the occurances where two adjacent lines are uncommented (means start with rm).

Thanks in advance.
Regards
Centurion
centurion555 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Two consective lines starting with same starting letter. centurion555 Sed and Awk 0 Mar 18th, 2009 8:31 AM
Reading character input into an array (raw mode) shoeyfighter C 3 Nov 2nd, 2006 3:49 PM
incrementing character array elements value n00b C++ 7 Jun 24th, 2006 3:44 AM
Sed, insert string to the beginning of a line Ken2 Sed and Awk 2 Jun 20th, 2005 12:09 PM
removing certain lines from a file Dizzutch Perl 9 Jan 26th, 2005 9:55 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:38 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC