0

I have a script with one of its command let say "cmd" this cmd will move the user from the shell to some other server/shell , now when I run this script after executing "cmd" the shell gets changed (normal behaviour) but the commands following the "cmd" will not run and when I logout from the new terminal to come back to original one then only that commands execute on their own .

Is there any way so that the remaining will execute on the new terminal ?

2
  • I do not understand your question. Maybe you could sketch some of the code you already have, so that we have something concrete to discuss? Commented Aug 30, 2016 at 10:15
  • 1. some commands ....... 4. qrsh -P ilight # command to open a new session on some server 5 .setenv display #### now I want to set this display on the session newly opened from qrsh command ... hope now its clear .. Commented Aug 30, 2016 at 11:03

1 Answer 1

-1

I'm assuming your "cmd" is ssh opening a session on another server. If thats the case you can instruct ssh to run a command once the session is open: ssh [email protected] your_command_here

3
  • exactly the cmd is opening a new session on some server but how to instruct it that commands following it have to be executed in the new session/terminal ? Commented Aug 30, 2016 at 11:01
  • ssh [email protected] your_command_here
    – Emil R
    Commented Aug 30, 2016 at 11:08
  • if I don't know the server/host name in which my new session will get open then ? Commented Aug 30, 2016 at 11:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.