Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The sed command

Status
Not open for further replies.

adelinewss

Programmer
May 22, 2000
20
SG
Hi,<br>I need to delete the content of files which start with /* and end with */.&nbsp;&nbsp;Like example:- <br><br>/* Today is Friday<br>Now is 3p.m. */<br><br>And also I need to delete the line from the start point with &quot;//&quot;.&nbsp;&nbsp;Like example:-<br><br>Today is Friday.&nbsp;&nbsp;//Now is 3p.m.<br><br>I want to delete //Now is 3p.m. onwards.&nbsp;&nbsp;<br><br>May I know how to do this with sed or other UNIX command?<br><br>Thks,<br>Adeline<br>
 
Hi, unixadmin!

It's very easy with awk. Please, try this command:

awk '{ print &quot;kill -9 &quot; $0 }' datafile > newfile

KP.
 
Try simply a [tt] kill -9 [red]`[/red]cat PIDfile[red]`[/red][/tt]...

Doesn't work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top