Version 2 of dislocate

Updated 2003-07-03 19:20:24

Ro: This is one of those gems that you don't come across very often. When you do find it, you're immediately enamored with it, your heart flutters, and a single tear rolls down your cheek. You find yourself pumping your fists in a fit of joy, and you cannot believe your good fortune. Atheists beware, because you might find yourself seriously considering switching teams.

Don Libes, creator of cgi.tcl made expect, and this script is a part of the expect distribution. It allows you to run a process that is immune to client-server disconnections and that is everpresent and eternally running.

I disconnect my bash shell with

  dislocate bash

Then a new bash shell starts up and I start running processes and doing my thing. I get my emacs going and open a zillion buffers. Woe to the server that hosts my emacs.

Now, even though I'm on broadband, and so is the granny next door, my connection is flaky. So lets say my ssh connection to that server goes kaput, what happens? No loss babe. (I'm running emacs through the bash shell, the dislocated sh process is just for show and tell)

  $ dislocate
  connectable processes:
   #   pid      date started      process
   1   9925  Thu Jul 03 15:12:35  sh
   2   9768  Thu Jul 03 15:04:09  bash
  enter # or pid:

I log back in via ssh, and !booya! dislocate lets me connect back up to the bash shell. My connection went kaput while I was in emacs, and can you BELIEVE IT i'm back in emacs at the exact same line with my gazillion buffers in the EXACT same way. A little ^L goes a long way to repaint my screen because my emacs needs some tender care and feeding.

Now I've just touched on this proggy (since I discovered it about an hour ago), but man is it neato. Oh and if you try and run a program that doesn't exist, you might get some flaky behavior. See your .dislocate file and remove the flaky program because something weird happens. But hey.

All in all, dislocate is beautiful.

http://expect.nist.gov/example/dislocat.man.html

Functional competitors: VNC; old-time screen [describe]; ...