Date: Thu, 21 Jun 2001 17:18:59 -0700 (PDT) From: Eric Boucher <eric_boucher60@yahoo.com> To: FreeBSD <freebsd-questions@FreeBSD.ORG> Subject: TCL: getting the PID of the current process Message-ID: <20010622001859.52952.qmail@web9402.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
Hi everyone, I want to get the pid of a process in TCL script. What I want to do is to get all the pids of a certain user for example with the command "ps -waux" and let's say I want to kill some. But to do this, I include the following line: set pids [exec ps -waux | grep -i user | cut -c9-19] After, I put it in a list and I want to delete the process that lauch it (so the "ps" command) because everybody knows that when you grep a "ps" command, you always get the pid of the command itself. But if I know the pid of the "ps -waux | grep ..." command, I can delete it from my list. So is there a way to catch the PID of the command you just lauched? In the man of Tcl, it seems that the "pid" command is only used for opening a file. If somebody knows it, can you include a short example please? P.S. If somebody knows a mailing list where I can ask question like you guys at FreeBSD or a newsgroup about TCL/TK, it will be appreciated too. Thanks a lot Eric __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010622001859.52952.qmail>