Question about processes

Started by
3 comments, last by Muzzafarath 24 years ago
(Not game dev related, but oh well...) Is there a way I can refer to a process by its name (not by its PID) when using commands like kill and fg? You can shut down vi (for example) like this (the list produced by ps is a bit simplified and probably not correct): $ vi & $ ps PID PROCESS 100 bash 101 vi 102 ps $ kill 101 Is there a way so I can do something like this?: $ vi & $ kill vi
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Advertisement
Not to the best of my knowledge, you may however be able to do it using

ps | grep vi

and get the PID somehow and then

kill the_PID

I haven''t used this stuff for ages so it is all theoretical. Maybe someone else has knowledge on this

-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)
Why would you want to do something like that? It is possible to run multipe instances of vi. In your example, how would you know what process to kill? All of them? Does not make logical sense to kill a process by it''s name.

Alek
It's not like I'm going to use it, I just want to know if it's possible While I'm waiting for my Red Hat 6.2 CD to come , I'm just trying to learn some of the basics in Floppix.

dwarfsoft, that might work, but I'm still referring to the vi process by its pid, not by its name

Edited by - Muzzafarath on August 6, 2000 2:16:05 PM
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
killall vi

http://www.thisisnurgle.org.uk

After careful deliberation, I have come to the conclusion that Nazrix is not cool. I am sorry for any inconvienience my previous mistake may have caused. We now return you to the original programming

This topic is closed to new replies.

Advertisement