[ale] Shell scripting

David S. Jackson dsj at sylvester.dsj.net
Mon Feb 10 09:06:06 EST 2003


On Sat, Feb 08, 2003 at 01:48:58PM -0500 Thomas Holmquist <fishy at ipa.net> wrote:
> Im writing a shell script that will put unique lines of text in a file
> 
> then I want to be able to delete the lines of text that contain a certan 
> keyword, how would I do this?

It's not clear exactly what you want to do, but I'll take a crack at it:

     === snip ===

#!/bin/sh

keyword=whatever

infile=/path/to/file
outfile=/path/to/file


uniq -u $infile | grep -v "${keyword}" > $outfile

     === snip ===

Of course, you could do this as a one-liner, too.  

Hey perl gurus, how would you do a "uniq" in perl?



-- 
David S. Jackson                        dsj at dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
I got this powdered water -- now I don't know what
to add.
		-- Steven Wright
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list