Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1  
Old 09-15-2005, 09:16 AM
jr13 jr13 is offline
Registered User
 
Join Date: Sep 2005
Posts: 6
HELP: sending commands to two screens

I was wondering how it is possible to send a special command to two screens at once. I tried to google the solution but nobody seems to know. For the start all i want to do is to send a "ls" simultanously to two screens. Does anybody happen to know how this is done ?

thanks in advance.

Last edited by jr13; 09-15-2005 at 09:30 AM.
Reply With Quote
  #2  
Old 09-15-2005, 09:35 AM
bocks's Avatar
bocks bocks is offline
VanDyke Customer Support
 
Join Date: Jan 2004
Location: Albuquerque, NM
Posts: 184
Hello jr13,
Quote:
Originally Posted by jr13
I was wondering how it is possible to send a special command to two screens at once. I tried to google the solution but nobody seems to know. For the start all i want to do is to send a "ls" simultanously to two screens. Does anybody happen to know how this is done ?

thanks in advance.
Let me make sure I understand what you are wanting to be able to do. Since this is the Scripting Forum, I am assuming that you are wanting to have a script that connects to two systems, and then send the same command to each session at the same time. Is this correct?

If not, are you wanting to be able to send the same command to all open sessions from the SecureCRT GUI?

To do this from the SecureCRT GUI, you will need to open the Chat Window on one session, and then right-click on the Chat Window. At the bottom of the menu, you will see an option called "Send chat to all sessions". By checking this value, you can enter a command or commands in the Chat Window and it will be sent to all open sessions, just as if you typed the command in each session's Tab.

Can you tell me a little more about your project and what you would like to be able to acconmplish with it?

Thanks,

-bocks
Reply With Quote
  #3  
Old 09-15-2005, 09:46 AM
jr13 jr13 is offline
Registered User
 
Join Date: Sep 2005
Posts: 6
ah thanks for the answere - you might have misunderstand it a little bit - sorry for that. and this might even be the wrong place to ask that question, but lemme go into more detail.

actually there is no detail, i am conenct to a system, running 2 screens and all i wanna do is to send a command simultanously to 2 screens. i would like to have a key mapped, so when i press it it sends i.e. "ls" to both screens.

-jr

Last edited by jr13; 09-15-2005 at 09:51 AM.
Reply With Quote
  #4  
Old 09-16-2005, 12:43 PM
bocks's Avatar
bocks bocks is offline
VanDyke Customer Support
 
Join Date: Jan 2004
Location: Albuquerque, NM
Posts: 184
Hi jr,
Quote:
Originally Posted by jr13
actually there is no detail, i am conenct to a system, running 2 screens and all i wanna do is to send a command simultanously to 2 screens. i would like to have a key mapped, so when i press it it sends i.e. "ls" to both screens.
This does help explain what you are looking for. As of right now, the only way to send a command to multiple screens is by using the Chat window as I described.

Will using the Chat window to send a command to all sessions meet your short term needs?

It is not currently possible to use the mapped keys to send to sessions other than the current one. If we had the ability to use mapped keys from the current session within the Chat Window, using the Chat window to send the commands to all sessions, would this be more along the lines of what you are looking for?

Thanks,

-bocks

Last edited by bocks; 09-19-2005 at 10:22 PM.
Reply With Quote
  #5  
Old 09-18-2005, 05:24 AM
jr13 jr13 is offline
Registered User
 
Join Date: Sep 2005
Posts: 6
Well, due to the fact that i am automatically pressing mapped keys, the chat window does not give the correct results. What i do now is to map a key with the following expression :
Code:
\001:at csh stuff "ls\015"\n
This sends the 'ls' command perfectly to all the open screens, but needed a bit of modification in the .screenrc file.
Neverthless thanks for the help.
Reply With Quote
  #6  
Old 09-19-2005, 10:32 PM
bocks's Avatar
bocks bocks is offline
VanDyke Customer Support
 
Join Date: Jan 2004
Location: Albuquerque, NM
Posts: 184
Hi jr13,
Quote:
Originally Posted by jr13
Well, due to the fact that i am automatically pressing mapped keys, the chat window does not give the correct results. What i do now is to map a key with the following expression :
Code:
\001:at csh stuff "ls\015"\n
This sends the 'ls' command perfectly to all the open screens, but needed a bit of modification in the .screenrc file.
Neverthless thanks for the help.
I think that I may have completely misunderstood the question that you are asking. Are you asking about having two Tabs in SecureCRT open, and sending the same command to both Tabs using the client to accomplish this, or are you talking about having multiple TTY sessions on the server (such as a virtual terminal in Linux)?

From the way that I read this last message, it sound more like the latter is the case. Can you verify this for me?

Can you tell me how you are activating the second screen?


Thanks,

-bocks
Reply With Quote
  #7  
Old 09-29-2005, 03:50 AM
jr13 jr13 is offline
Registered User
 
Join Date: Sep 2005
Posts: 6
Yes, i was talking about TTY's.
The command that i pasted above does send to all the screen at once.

Btw. another thing.
If i have like five tabbed sessions open and i would like to run a script on each of those tabs at once - how cna i do that ?
Reply With Quote
  #8  
Old 10-04-2005, 02:16 PM
bocks's Avatar
bocks bocks is offline
VanDyke Customer Support
 
Join Date: Jan 2004
Location: Albuquerque, NM
Posts: 184
Hi jr13,
Quote:
Originally Posted by jr13
Yes, i was talking about TTY's.
The command that i pasted above does send to all the screen at once.

Btw. another thing.
If i have like five tabbed sessions open and i would like to run a script on each of those tabs at once - how cna i do that ?
Does the script reside on the servers, or on the client?

If the script resides on each server, then you will be able to use the Chat Window.

In the primary session, click on the View menu and enable the Chat window. Now, right-click on the Chat Window. At the bottom of the menu, you will see an option called "Send chat to all sessions". By checking this value, you can enter a command or commands in the Chat Window and it will be sent to all open sessions, just as if you typed the command in each session's Tab.

If there is a script that resides on each system, you just need to type the command to execute the script into the Chat Window and hit return. The data will be sent to each of the open Tabs, just as if you typed it in the normal session window.

Unfortunately, if the script to be executed resides on the client running SecureCRT, there is no way to automatically execute the script in each session Tab at the same time. The script will need to be started in each session by hand.

If you are trying to automate a process that will issue the same commands to multiple servers and then process the output, without human interventions, you may want to try using a script that opens each session in turn, runs the commands, processes, closes the session, and then continues to the next session. Would something like this fit your needs?

Thanks,

-bocks
Reply With Quote
Reply


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 11:27 PM.