The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Basic Linux Shell Scripting for Oracle DBAs iBot Oracle Updates (RSS) 0 04-06-2008 05:10 AM
Shell scripting basic doubt sendhilmani123 Shell Programming and Scripting 3 08-04-2006 06:07 AM
Shell Scripting Question tech2040 Shell Programming and Scripting 3 08-10-2005 01:32 AM
Shell Scripting Question tech2040 Shell Programming and Scripting 1 08-09-2005 02:34 AM
What is a good place to learn basic shell scripting? Thanks! deutchap6verse5 Shell Programming and Scripting 2 03-08-2005 02:55 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-27-2007
convenientstore convenientstore is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 42
basic shell scripting question

If I did indeed grep something out of it, why woudln't $result show nothing?
When I do $? , it does show success...

What is the proper syntax so that $result shows actual thing it's grepping out?

result=`(ssh $host tail -1 /something/somethingelse) | egrep -i "value" >dev/null`

#echo $result
#
#echo $?
#0
  #2 (permalink)  
Old 05-27-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
result=`(ssh $host tail -1 /something/somethingelse) | egrep -i "value" >dev/null`

Becuse that's what you told it to do.
  #3 (permalink)  
Old 05-27-2007
convenientstore convenientstore is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 42
u r abousteli rite.. that was stupid of me
  #4 (permalink)  
Old 05-27-2007
convenientstore convenientstore is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 42
I am trying to get below to be rite...

is this rite ?

in below.. (in dosomething), I cannot use elif.. since i have no condition..

can someone advise?


if something
then
somethingelse
else
dosomething <----- especialli this one
if something1
then
somethingelse1
else
somethingelse2
fi
fi
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0