What is going on with ash / sh

Dan Nelson dnelson at allantgroup.com
Wed Nov 2 20:40:07 UTC 2011


In the last episode (Nov 02), Mark Saad said:
> Hackers
>  What is going on here, if I run the following shell script, what is
> the expected output . The script is named xxx
> 
> #!/bin/sh
> ps -ax | grep -v grep | grep xxx
> 
> Here is what I see
> 
>  # sh xxx
> 88318  p0  S+     0:00.00 sh xxx
> 88320  p0  R+     0:00.00 sh xxx
> 88321  p0  R+     0:00.00 sh xxx
> 
> Can someone explain this ?

What does your script do?  If it contains subshells or pipelines, the main
process will fork child processes to handle those.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-hackers mailing list