Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSH Escape Sequences

Status
Not open for further replies.

CamaroLT

Programmer
Dec 16, 2002
159
CA
Hey there;

I'm sending commands to start a program on a remote server, but the program is known to lock SSH sessions 100% of the time. Why, I don't know, how, I don't know. I didn't write the program. ;)

Anyways, what I'm doing is this:

ssh remoteserver "runmyprog; ~."
zsh: command not found: ~.

I've tried using ~~. and it just says ~~. not found

I've tried using \e and it says e. not found

I've verified that the ssh_config file has EscapeKey set to ~

Anyone know how I can get the shell to terminate once complete?

Thanks.

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=
NEVER send the boss to do a techs job
 
I've now tried \n~. and it tells me n~. is not found. Giving up for now. {smirk}

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=
NEVER send the boss to do a techs job
 
Just start the programme in the background, ideally using nohup and redirecting the stdout and stderr appropriately, and your SSH session should terminate as soon as it is launched, e.g.

[tt]ssh remoteserver "nohup runmyprog > runmyprog.out 2>&1 &"[/tt]

Annihilannic.
 
Excellent. Worked perfectly. New command to add to the records. ;)

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=
NEVER send the boss to do a techs job
 
I think the nohup accomplishes the same thing as the -n option in ssh (redirect stdin from /dev/null). This is often why ssh hangs because stdin is still open.

Try it just with the -n for yucks.
 
Elgrande; No, it didn't work. I first tried to log in without a parameter, and it pretty much killed the session. Didn't let me have input. As what stdin is supposed to be. I then tried to run commands, but it didn't return back to the prompt.


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=
NEVER send the boss to do a techs job
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top