The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Aite Group Finds Huge Gains for CEP iBot Complex Event Processing RSS News 0 02-06-2008 08:50 AM
Survey finds Windows losing ground with developers - Computerworld New Zealand iBot UNIX and Linux RSS News 0 07-09-2007 04:40 AM
SETI Finds Stolen Laptop Perderabo News, Links, Events and Announcements 2 04-05-2007 07:14 PM
fixing the error message when grep doesn't finds the pattern. silver123 UNIX for Dummies Questions & Answers 1 03-03-2006 02:59 AM
Appending to filename a string of text grep finds HLee1981 Shell Programming and Scripting 3 09-06-2005 11:44 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #8  
Old 03-01-2001
Registered User
 

Join Date: Feb 2001
Posts: 5
The script you wrote is very similar to mine, isnt'it?
Forum Sponsor
  #9  
Old 03-01-2001
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Yep, I lost a closing quote. Typo.

It is similar to the original script you posted, except that instead of piping the line count to "read", I just assign it directly to a variable -- this is a cleaner and more direct method of doing it. I also eliminated the
"grep -v grep" with a little shell trickery -- the [s]quare brackets on the first letter of the script name. Its a personal preference, but I like this method better.
  #10  
Old 03-02-2001
Registered User
 

Join Date: Feb 2001
Posts: 5
Thanks for your reply, but I have tested your code and my code 100 times (with a "for" writing to a log) and your code has failed 74 times and my code 63.

My question is why fails it?



Thanks in advance.

  #11  
Old 03-02-2001
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
I recommend saving the output of your ps command (without the 'wc -l') to a log file so that you can see why it is failing.

Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0