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
problem with dd command or maybe AFS problem Anta Shell Programming and Scripting 0 08-25-2006 07:10 AM
SSH Problem auth problem budrito UNIX for Advanced & Expert Users 1 03-17-2004 06:12 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-30-2008
Registered User
 

Join Date: Aug 2005
Posts: 229
problem get the value of /usr/ucb/ps -guxww

Hello all
im trying to get the value of:
PHP Code:
/usr/ucb/ps -guxww grep Tomcat grep $USER grep -v grep 
into variable , im using csh .
like this :
PHP Code:
set PS="/usr/ucb/ps -guxww"
set isTomcat = `cat $PS | grep Tomcat | grep $USER | grep -v grep
but im keep geting this error:
PHP Code:
catcannot open -guxww 
how can i get the output right ?
thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-03-2008
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Get rid of the cat.
Code:
set PS="/usr/ucb/ps -guxww"
set isTomcat = `$PS | grep Tomcat | grep $USER | grep -v grep`
Reply With Quote
  #3 (permalink)  
Old 02-03-2008
Registered User
 

Join Date: Aug 2005
Posts: 229
but now if i do :
echo $isTomcat im getting the error:
PHP Code:
setNo match 
why ? how can i echo the value ?
Reply With Quote
  #4 (permalink)  
Old 02-03-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 674
Your code actually works for me when I try it...
Obvious question: Is the $USER variable set correctly?
Reply With Quote
  #5 (permalink)  
Old 02-03-2008
Registered User
 

Join Date: Aug 2005
Posts: 229
yes it does
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:42 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