ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Find And Run Robot

Alias help needed

<< < (2/3) > >>

fjorge:
The use I have in mind is that I use an ssh client and I can pass it the session I want to open as a parameter. The different sessions that I have preconfigured are stored in a folder under different filenames: 1session.ini, 2session.ini, ... What I want is to be able to type 'ssh' in FARR and to get all possible sessions in the list. Then if I type '2' only sessions starting with 2 will remain in the results. Note that the parameter I have to pass to the client is '2session', not '2session.ini', so there should be a way to delete the extension of the files.

I have tried something like:

Regular Expr Pattern:
^+ssh (.*)

Results:
C:\Archivos de programa\SSH\ssh.exe dosearch D:\Documents and Settings\t148594\Datos de programa\SSH\Sessions\$$1.ini

But it does not seem to work. It only shows the files that match the argument I type after ssh, and not even those in the folder I specify after the dosearch command, but all of them.

Is it not possible to add strings before and after the results? I think this could help me.

mouser:
ok so this is sort of similar to the work ewemoa did on a putty plugin for farr (see here: https://www.donationcoder.com/forum/index.php?topic=16498.0)

and i think we can see a general use pattern in what you want, that could be useful in other cases.

in general terms, you want to be able to type a keyword and extra search terms that will search a specific folder and do filtering according to the search terms, and then when a file is chosen/launched, you want to launch some specific program and pass the filename (perhaps manipulated to remove the .ini or other stuff) as an arguement.

it seems to me that is something that could have uses beyond ssh and so might be worth figuring out a general solution to, maybe using a plugin, to keep it clean.

let me give it a little more thought about the most sensible way to do it that would be more generally applicable.

the easiest way to do 99% of what you want is to create a new alias, lets call it sshlaunch
with regex pattern as you say: ^+ssh (.*)
then in the results but something like
"dosearch D:\Documents and Settings\t148594\Datos de programa\SSH\Sessions\ +openinssh"

that should make it that typing ssh blah
will show matching filles in the sessions directory, as you want

and it would add a special modifie "+openinssh" to the search string

then the missing piece is that you need a plugin to look for "+openinssh" and know that that means to open the file using
"C:\Archivos de programa\SSH\ssh.exe" and passing the filename (without file extension) as an arguement.

its that last part that you would still need a plugin for.

now this does bring up an interesting idea, which would be to add something to farr that would let you handle this without a plugin, perhaps by letting the alias specify not just a dosearch but some kind of dolaunch statement.  so that the ssh alias would specify how to launch the result after it is triggered..

fjorge:
Yeah, you have caught the point. That is exactly what I would need. Do you think it is doable?

mouser:
oh its definitely doable and i cant see why you'd have to wait more than a week or so for a good solution.. there is a member on the site (nitrix-ud) who can usually find some ingenius way to do things with farr and he could probably find a solution to this without any new coding, but i still think this is a good candidate to figure out a more general solution.

fjorge:
I look forward to seeing this implemented in FARR.

Thanks a lot.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version