LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-17-2004, 02:07 AM   #1
antony_csf
Member
 
Registered: Jun 2004
Posts: 51

Rep: Reputation: 15
how can i get the process id on exec a process


I am a newbie on linux !!

how can i get the process id on exec a process

can i store the pid in a file when i exec a program such as :

exe java HelloWorld

How can i get the process id when creating a new process

and kill it by a period of time???

thx for help!!
 
Old 06-17-2004, 03:06 AM   #2
sporadic235
Member
 
Registered: May 2004
Location: Osaka
Distribution: FreeBSD 5.2, Mandrake 9.2
Posts: 39

Rep: Reputation: 15
try the following:

ps -aux | grep <name of application> | cut -c byte[n-1]-byte[y-1]

and if you want to kill it, you have to write a script like:

procid = ps -aux | grep <name of application> | cut -c byte[n-1]-byte[y-1]
at <set time> kill -9 procid
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 07:26 AM
Linux boot up process Vs. Windows boot up process darkskull Linux - Software 7 12-30-2006 04:21 PM
Process ID Timok Programming 3 10-04-2005 11:54 AM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 01:19 PM
problem with binding process and than execute another process chapa Programming 0 08-27-2003 03:47 AM


All times are GMT -5. The time now is 10:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration