Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

feel strange about the "[rm]" process 2

Status
Not open for further replies.

pissallio

IS-IT--Management
Oct 2, 2004
36
CN

I have written a Korn Shell script like this:

a=1
while a=1
do
for i in a b c
do
touch $i
rm $i
done
done

during the running of the scripts, i execute "ps -ef|grep rm" repeatedly to observe the "rm" process.
i found :
root 12716 11576 0 00:51:39 pts/2 0:00 [rm]
but suddenly the "[rm]" would disappear and soon later it will emerge again.

I want to understand what does "[rm]" mean ?
 
hi ,
you are getting rm[] on certain occassions because , at the time you do a ps -ef , it is doing a command substitution
rm [] , waiting to be rm a , b or c
 
When ps output shows a command in square brackets, it means that ps was unable to retrieve extended information about the process from memory and is just showing the name stored in the kernel.

This generally happens when a process is being destroyed. Considering the speed at which you're creating and deleting files, it's no suprise that you catch the system in the middle of the death of an rm from time to time. I'd wager that when the [rm] disappeared and reappeared, it had a different PID, because it's a different instance of rm.

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top