bash scripting try something, but quit if it's taking too long

Matt Price moptop99-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue Jun 22 14:51:38 UTC 2010


hi,

quick scripting question.  I have an irritating emacs bug, in which
emacs sometimes hangs when the network's disrupted.  To deal with this
i have just send a command via emacsclient to the running server
before i suspend, which solves a solid 90% of my problems.  but
sometimes emacs is already hung when i want to suspend!  in that case,
my script hangs too and the suspend event never takes place, which is
almost always worse since it causes everything to lose data, not just
emacs.  here's my tiny function:

suspend_wl()
{
	# Get WL to go offline
        if [-f /tmp/emacs1000/server]
	    then
            /usr/bin/emacsclient --socket-name /tmp/emacs1000/server
--eval "(wl-toggle-plugged 'off)"
	fi
}
is there a "try" or similar command i can use around the emacsclient
command, to just continue if things are taking too long?

Thanks a bunch, as always!
matt
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list