Quoting Karsten M. Self (kmself@ix.netcom.com):
> > > csj ([EMAIL PROTECTED]) wrote:
> > > > Is there a way to copy or paste text into bash without the use of
> > > > a mouse? I'm thinking of a text file "file.txt" which contains
> > > > command sequences which I would like to touch up before running.
> > > >
> > > > I don't want to use an editor for this. Just the line editing
> > > > functions of bash. Offhand the only (untested) solution I can
> > > > think of is something like "cat file.txt >> .bash_history",
> > > > subsequently invoking another bash session. Is this stupid
> > > > (dangerous)? Does someone have a better solution?

That looks OK to me, and no more dangerous than having a line
like rm -f * sitting in your history because you used it in
a different context from now. (I always keep lines like that
out of my history by putting a space at the front.) 

> I think there's a disconnect here -- your request is either so simple
> that I don't understand what the problem is, or is fundamentally at odds
> with the GNU/Linux process/data/stream model.  Are you familiar with the
> fundamental concepts of streams, pipes, stdin, stdout, and input/output
> redirection?  As far as I can understand, you're simply looking for a
> method to invoke bash on a command stream.
> 
> Why don't you step back, take a breath, describe your situation, what
> you hope to accomplish, and what specific options are ruled out.

You can recall lines from the history buffer (saves typing them), but
edit them before executing them, where the editing you do (and, indeed,
whether you use the same sequence of commands) may depend on the output
observed from some of those same commands. You can't do that with pipes
and streams.

Cheers,

-- 
Email:  [EMAIL PROTECTED]   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.

Reply via email to