2
« on: July 13, 2016, 03:21 PM »
Hi all ....
I'm trying to automate logging in to remote hosts via ss and execute shell scripts saved in a local folder on the PC. The final commands looks like this
ssh user@host_name my_shell_script.sh
I have 2 variables. First is host_name and a second is my_shell_script.sh
I created 2 aliases ...
1) script_lib which does a 'dosearch' on the folder where scripts are saved
2) exec_ssh defined as 'ssh (.*) (.*) and the pass to the ssh binary 'c:\....\ssh.exe jsmith@$$1 $$2'
In the farr search box I type ....
script_lib get_host_name.sh +exec_ssh
This command passes the get_host_name.sh search hit as $$1 to action alias +exec_ssh. It needs to pass as $$2 since $$1 is the host name. The tool I'm using requires this ordering of arguments.
How can I do this in farr, please.
Thanks