[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pasting text into bash without use of mouse



On Mon, Apr 09, 2001 at 02:06:50AM +0800, csj wrote:
> On Sunday 08 April 2001 08:48, Karsten M. Self wrote:
> > Command Substitution:
> >
> >     $ cat <<EOF >cmd.lst
> >     df
> >     ls
> >     uptime
> >     EOF
> >
> >     $ $( grep df cmd.lst )
> >
> > QED.
> 
> Not quite QED (tho quite close). What I'm looking for is how to edit 
> and execute an EXISTING cmd.lst. Sorry if I'm missing something 
> perfectly obvious. Hope this is the penultimate strand on this thread.

How about `sed` the "stream editor" ? and `cut` ?

locate .htm \
	| xargs grep -h www.dribble.net \
	| cut -f2 '-d<' \
	| sed -e 's/dribble.net/blither.org/' \
	> myfile.out

How (and whether) you use cut would depend on your html coding
standards, of course...

Of course, with 'grep -h ...' you'll never know which files the
original text sprung from. But you probably know that.

-- 
does a brain cell think?

will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!



Reply to: