Interrupting program from command line

Interrupting program from command line

Post by Alex Vinoku » Sat, 28 Jun 2003 01:32:37



Hi,

I have some program that works endlessly.
I want the program to be interrupted in some time after starting.
Is it possible to do that from command line?

Something like (pseudo-code) :
$ run 6 sec my_program,

   ==========================================
   Alex Vinokur

     http://www.simtel.net/pub/oth/19088.html
     http://sourceforge.net/users/alexvn
   ==========================================

 
 
 

Interrupting program from command line

Post by Bjorn Rees » Sat, 28 Jun 2003 01:56:50



> Something like (pseudo-code) :
> $ run 6 sec my_program,

How about this? (for tcsh -- the exact syntax may differ if you
use another shell)

$ my_program & ; sleep 6 ; kill $!

 
 
 

Interrupting program from command line

Post by stanislav shaluno » Sat, 28 Jun 2003 05:18:11



> I want the program to be interrupted in some time after starting.
> $ run 6 sec my_program,

The Expect distributuion includes a program, timed_run, that does
exactly that.  It's even installed by default.

--
Stanislav Shalunov              http://www.internet2.edu/~shalunov/

I receive a lot of spam every day, much of it offering to help me
get out of debt or get rich quick.              --Bill Gates

 
 
 

1. Adding header lines using command line mail program



:Hi.
:
:I'm interested in running a mail sending program (such as mail,
:fastmail, elm) on the command line, passing the  body of the message
:through stdin, but ensuring that the header of the message contains a
:few particular lines - namely "Mime-Version: 1.0", "Content-Type:
:application/octet-stream; name=thefile.gif", and
:"Content-Transfer-Encoding: Base64".

The idea is to point the program to an alternate sendmail program
which is a simple script that does:

#!/bin/sh
cat /path/to/your/headers - | /usr/sbin/sendmail $*

And have /path/to/your/headers contain the headers you want.

With Berkeley mail, you'd "set sendmail=/path/to/above/script" in
the .mailrc.

With elm, you could use ~/.elm/elmheaders, swapping in your own
when you need to use an instance of elm for your application.

--

 InterNIC WHOIS: MJO | (has my PGP & Geek Code info) | Phone: +1 248-848-4481

2. Netscape Collabra keeps losing my news server.

3. Is there a command line dial program?

4. Wizard-level questions

5. Too many command line options in a program

6. mouse cursor

7. Howto: A simle command line mail program

8. latest relase of SLS

9. Can I change the default process schedule policy through command line or program ?

10. how to program UP CURSOR to repeat previous command lines ?

11. Command line FTP program for either UNIX or DOS

12. Command line history for programs (or atty)

13. informix program command line arg puzzle