The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command not found BigTool4u2 UNIX for Dummies Questions & Answers 2 03-07-2008 10:40 PM
cc command not found mishra_sk_in UNIX for Dummies Questions & Answers 4 08-14-2007 02:00 AM
command not found simba_tsavo UNIX for Advanced & Expert Users 1 07-05-2006 06:17 AM
sh: Hello: command not found coolboarderguy Shell Programming and Scripting 2 06-24-2006 01:27 AM
xlf: command not found!!!! mzzt AIX 2 01-05-2006 01:19 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-25-2007
Registered User
 

Join Date: Aug 2005
Posts: 229
how can i check in csh if command found or not found ?

hello all

im trying to use in sun Solaris the information received from the top command

now i several machines that dont have install the top program so when im running the script im geting error

saying after im running this code :

Code:
set MemoryInfo = `top | grep Memory`
      if ( $status != 1 ) then
        echo $MemoryInfo
      endif


top: Command not found
how can i prevent the printing of any error coming from executing unix application with tcsh ?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-25-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,473
usually top would be available at /usr/bin/top ( If you are sure, there is no top available, you can leave it )

to supress any error, if you are sure you dont need them for debugging purpose then

Code:
anycommand 2>/dev/null
Reply With Quote
  #3 (permalink)  
Old 03-03-2007
cfajohnson's Avatar
Registered User
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 487
Don't use [t]csh for scripting.

http://www.grymoire.com/Unix/CshTop10.txt
http://www.grymoire.com/Unix/Csh.html#uh-0
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

Last edited by cfajohnson; 03-04-2007 at 04:04 PM. Reason: typo: s/or/for/
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:49 PM.


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

Content Relevant URLs by vBSEO 3.2.0