X-Spam-Check-By: sourceware.org
X-YMail-OSG: NkZFCZUVM1mrR7ago.IzLL5dt8jqA5A1P3ISSu3IZ2BVpQ3PD4XuU_uldft.D0Bf8a9OtS3mXQ--
Message-ID: <460C223B.60105@yahoo.com>
Date: Thu, 29 Mar 2007 14:31:55 -0600
From: Keith Christian <keithchristian@yahoo.com>
User-Agent: Debian Thunderbird 1.0.2 (X11/20070113)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: grep will not work with a variable?
References: <mn.eb517d73f1140792.51129@pbs.org> <460C1525.8060305@yahoo.com> <mn.ebab7d7390ec83d9.51129@pbs.org>
In-Reply-To: <mn.ebab7d7390ec83d9.51129@pbs.org>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Kevin Markle wrote:
> Keith Christian brought next idea :
> 
>> Kevin Markle wrote:
>>
>>> Hello,
>>>
>>> I'm trying to find a pattern in a file and the command works if I 
>>> manully put the output of the variable in it but when I use the 
>>> variable it fails? I have tryed with quotes "$CLIENT" and without. I 
>>> don't know what else to try? :-(
>>
>>
>> echo "Client variable is --> \"${CLIENT}\""  ;  grep "${CLIENT}" foo.txt
>>
>> What does that tell you?
>>
>> ========Keith
> 
> 
> I tryed adding a cd to the directory that I was attempting to grep from 
> and that worked? This is okay because is worked but it would be nice to 
> not have to so that...


Ok, suppose foo.txt is in /home/fflintstone/foo.txt, then:

echo "Client variable is --> \"${CLIENT}\""  ;  grep "${CLIENT}" /home/fflintstone/foo.txt

=======Keith

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

