This answers only the specific example, however, the user is asking for a more general capability that this answer does not provide.
–
mdpcFeb 11 '13 at 20:15

Yeah this is a nice solution to my specific problem, but if there was a way to grab previous text in bash that would be awesome
–
LittleBobbyTablesFeb 11 '13 at 20:18

If I was aware of a general way I would have mentioned it. Should I not have pointed out the specific solution? It should be possible to create something within PS1 (probably beyond "simple" for average perception) that checks this for virtual terminals (screendump) or screen sessions with enabled logging but that's far from general.
–
Hauke LagingFeb 11 '13 at 20:44

Copy/paste is the standard solution for this. Of course, the example you give could be remediated with the mail command, but I understand that there may be other other examples that could benefit.

For instance, I use the Eterm terminal on my Mac and Linux systems. It parses directory paths and URL's incredibly well (PuTTY doesn't). xterm and rxvt do the same. The double-click action is based on the delimiter defined as cutChars; Typically, those are spaces and any of the following:

\\ `\"\'()*;<>[]{|}

Double-click for the URL/path.Triple-click to grab the URL/path to the end of the line.

That may make your copy/pasting action more convenient. It's a small detail...

I'm giving you an upvote since this is a nice answer, but its not quite the previous bash text-grabbing solution that I am currently searching around for. But Thanks :)
–
LittleBobbyTablesFeb 11 '13 at 21:29