Assuming a script that outputs a list of files:
$> bash someScript.sh
path/to/some/file
path/to/the/file/i/want/to/work/with
path/to/yet/another/file
Now I want to have the second file-path as parameter for another command, e.g. vim
. Is there a way to directly access it?
And I want to point out that I do not necessarily want to access the second file, but the next time it could be the third or the 27th. I want to be able to select that Nth line as easily as possible.
Right now I do mouse-selecting and insert by middle-clicking or type the path with tab-completion. Now I wonder if there is an easier way.
Problem with my own solution is though that I would have to edit all my scripts this way. It would be fun if there was a more general solution to this issue, that would work with any kind of command, e.g. find
.
ls
output, read this first. – jw013 Jan 24 '12 at 17:25