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
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr HP-UX 1 10-16-2006 01:16 PM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr Shell Programming and Scripting 0 09-19-2006 06:44 PM
wc command help.... and other unix command....... urgent dashi2k UNIX for Dummies Questions & Answers 1 01-20-2005 03:39 PM
UNIX command jodders UNIX for Dummies Questions & Answers 2 02-15-2004 07:34 AM
Unix command help JJJ UNIX for Dummies Questions & Answers 3 03-11-2002 06:39 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-29-2005
Registered User
 

Join Date: Aug 2005
Posts: 39
Question How to run a unix command in VI

Hi,

I have below command to run in from a file.
Aim to run this command and assign that to a variable.

ps -ef | grep keepalive | grep -v keepaliveStub | grep -i ficctprd | grep -v grep | awk '{ print $2 }'

How can i do that?

Thanks,
Sateesh
Reply With Quote
Forum Sponsor
  #2  
Old 08-29-2005
Registered User
 

Join Date: Aug 2001
Posts: 179
use
var1=`ps -ef | grep keepalive | grep -v keepaliveStub | grep -i ficctprd | grep -v grep | awk '{ print $2 }'`



or
var1=$(ps -ef | grep keepalive | grep -v keepaliveStub | grep -i ficctprd | grep -v grep | awk '{ print $2 }')
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:12 AM.


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