niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » shell
grep pattern with variable included
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Ed Morton
*nix forums Guru


Joined: 20 Feb 2005
Posts: 1073

PostPosted: Mon Feb 14, 2005 1:09 pm    Post subject: Re: grep pattern with variable included Reply with quote

erik wrote:

Quote:
grep -A 420 ':dn ("CN=$dir'
/home/erik/solectron/conf/$dir/objects_5_0.C > ./wall-specific-grab

That is the command. The $dir is a variable. I cannot get the quotes
correct. The left paren is part of the actual search pattern. How can I
do this. I have tried putting double quotes on the outside but the
double quote before the CN gave me problems.


grep -A 420 ":dn (\"CN=$dir" ...

Ed.
Back to top
erik
*nix forums beginner


Joined: 10 May 2005
Posts: 46

PostPosted: Mon Feb 14, 2005 12:13 pm    Post subject: grep pattern with variable included Reply with quote

grep -A 420 ':dn ("CN=$dir'
/home/erik/solectron/conf/$dir/objects_5_0.C > ./wall-specific-grab

That is the command. The $dir is a variable. I cannot get the quotes
correct. The left paren is part of the actual search pattern. How can I
do this. I have tried putting double quotes on the outside but the
double quote before the CN gave me problems.
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 11:11 pm | All times are GMT
navigation Forum index » Programming » shell
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix + MySQL error: very strange variable %s iWarior Postfix 0 Mon Aug 25, 2008 2:01 pm
No new posts User Environment - export PATH variable paalepu AIX 0 Tue Sep 12, 2006 8:12 pm
No new posts Match pattern in ksh script lnrntx@gmail.com shell 6 Thu Jul 20, 2006 1:48 am
No new posts how to alias an array with a variable in a loop ? Jack Perl 4 Wed Jul 19, 2006 8:17 pm
No new posts Writing a function that changes an unknown-type numeric v... pozz C 8 Wed Jul 19, 2006 5:23 pm

WoW Gold | Credit Cards | Credit Counseling | Mortgage | MPAA
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3412s ][ Queries: 20 (0.2692s) ][ GZIP on - Debug on ]