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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Compare 2 array files using grep lanna001 UNIX for Dummies Questions & Answers 2 04-22-2009 10:32 AM
Using grep to compare files and extract the difference to another output file spartan22 UNIX for Dummies Questions & Answers 6 02-23-2009 04:51 PM
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else hariza Shell Programming and Scripting 4 09-18-2008 03:56 AM
Compare two arrays in sh or compare two fields rijeshpp Shell Programming and Scripting 0 10-31-2007 02:47 AM
compare grep? k@ssidy UNIX for Dummies Questions & Answers 7 06-15-2005 12:59 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-15-2009
ravi18s ravi18s is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 17
Unhappy how to grep and then to compare

Hello to all,
i am new to scripting. I had to ques...1) If I had a variable $a which contains value i.e abc= jack
I want to grep it first and then put into the variable lets say $b.
Ques 2) If there is a file name.txt in which there are 15-20 names
-----name.txt------
jack|male|london
prink|male|hague
john|male|france
nincey|female|calif
-------------------
now I want to compare the value of $b with each name in name.txt
Thank you....
 

Bookmarks

Tags
grep, scripts, sed

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 01:54 AM.


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