Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-31-2018, 03:18 AM
amy_itx_aps amy_itx_aps is offline
Registered User
 
Join Date: Dec 2018
Posts: 8
vbs scripts login unix

ip_uu_pass.txt file :

ip user password path
192.168.80.123 oracle oracle /home/oracle/data
192.168.80.124 app app /home/app
192.168.80.3 han han /home/han


Use the vbs script to read each line in the file one by one and log in to Unix, and according to the path in the ip_uu_pass.txt file, each logged-in host is cd to the corresponding directory. How to implement this function?
Reply With Quote
  #2  
Old 12-31-2018, 10:32 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 595
Hi amy_itx_aps,

We do have an example script avaialable the demonstrates connecting to a list of devices and running a set of commands.

Read Data From Separate Hosts/Commands File And Log To Individual Files
Currently the script is designed to run the same set of commands on every host in the list. With a little modification you may be able to get the behavior you're looking for.

Does this example help?
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 12-31-2018, 10:42 PM
amy_itx_aps amy_itx_aps is offline
Registered User
 
Join Date: Dec 2018
Posts: 8
vbs scripts

Thank you very much for your support. Your script may still be different from what I expected.

I want a script that reads the host.txt file one by one to get the ip user password path in the host.txt file. ssh2 logs in to many unix hosts and executes some commands on each host.

Host.txt :
192.168.80.123 oracle oracle /home/oracle/data
192.168.80.124 app app /home/app
192.168.80.3 han han /home/han

like this:
After logging in to 192.168.80.123, execute cd /home/oracle/data/
Login 192.168.80.124 After successful Execute cd /home/app
After logging in 192.168.80.3, execute cd /home/han
Reply With Quote
  #4  
Old 01-03-2019, 09:49 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 595
Hi amy_itx_aps,

I have reviewed the script you provided in another forum post and responded there.
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

Tags
cd path


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 07:26 PM.