OT - shell script to kill a process

Chris Sheffield cmsheffield at gmail.com
Tue Jul 10 12:43:09 EDT 2007


Okay, I think I figured out the problem.

The pid as returned from ps has a different number of leading spaces  
depending on the number of digits in the pid. So using a set value  
for the -f option doesn't seem to work. For example, if the pid has  
four digits, using 2 works since the pid has 2 leading spaces. But if  
it has 3 digits, you have to use 3 to get the pid returned correctly  
since it has 3 leading spaces. Am I making sense? It's kind of  
confusing to me. Anyway, can you think of a way around this? Is there  
some other command that would work instead of cut, or some other form  
of cut maybe?

Thanks again.


On Jul 10, 2007, at 9:28 AM, Chris Sheffield wrote:

>
> I've got another question for you though. It concerns the 'cut -d\   
> -f2' part of this. This doesn't seem to be working correctly. Can  
> you explain more what's supposed to happen here? It seems to just  
> be returning an empty string, so a valid pid is never passed on.  
> I've tried it using TextEdit as well as using my own process in the  
> command. Any thoughts?

------------------------------------------
Chris Sheffield
Read Naturally
The Fluency Company
http://www.readnaturally.com
------------------------------------------





More information about the use-livecode mailing list