LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 02-09-2008, 11:09 PM   #1
cryincold
Member
 
Registered: Sep 2007
Location: Zhuhai, China
Distribution: Debian, etch
Posts: 40

Rep: Reputation: 15
VIM: How to delete all lines that include special words.


A simple text edited by VIM as showed below:
Quote:
objects = shit.d

$(objects) : %.d : %.c
@set -e
@echo -n "Script Process ID"
@echo $$
rm -f $@
@echo -n "Script Process ID"
@echo $$$$
gcc -M $< > $@.$$$$
@echo -n "Script Process ID"
@echo $$$$
sed 's, \($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ >$@
@echo -n "Script Process ID"
@echo $$$$
rm -f $@.$$$$
I wanna use vim commands to delete all lines that include '@' character.
So, i typed this command:
: g/@/delete
Result in only the first 3 lines are left.
What should i do ?

TKU in advance !
U help would be greatly appreciated.
 
Old 02-09-2008, 11:11 PM   #2
cryincold
Member
 
Registered: Sep 2007
Location: Zhuhai, China
Distribution: Debian, etch
Posts: 40

Original Poster
Rep: Reputation: 15
Faint ...
Sorry
I made a mistake ...
I did it ~~~

SORRY .....
 
Old 02-09-2008, 11:13 PM   #3
cryincold
Member
 
Registered: Sep 2007
Location: Zhuhai, China
Distribution: Debian, etch
Posts: 40

Original Poster
Rep: Reputation: 15
This way...

Quote:
g/^\s*@/delete

Last edited by cryincold; 02-09-2008 at 11:19 PM. Reason: Problem Solved ...
 
Old 02-09-2008, 11:17 PM   #4
cryincold
Member
 
Registered: Sep 2007
Location: Zhuhai, China
Distribution: Debian, etch
Posts: 40

Original Poster
Rep: Reputation: 15
Quote:
g/^\s*@/delete
Problem has been Solved ~
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how many lines and words (bash) sharapchi Programming 4 12-15-2006 12:45 PM
awk/gawk/sed - read lines from file1, comment out or delete matching lines in file2 rascal84 Linux - General 1 05-24-2006 09:19 AM
Bash - How to make For read lines instead of words in a list ? landuchi Programming 10 02-15-2006 01:36 PM
delete words in vi & autologin? hraposo Slackware 6 10-02-2004 10:12 AM
how can i find all include special word in a dir henryluo Linux - General 4 11-12-2003 10:56 AM


All times are GMT -5. The time now is 09:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration