Re: grep with 2 variables
- From: contracer <contracer11@xxxxxxxxx>
- Date: Fri, 17 Sep 2010 09:25:44 -0700 (PDT)
On 17 set, 13:13, "Chris F.A. Johnson" <cfajohn...@xxxxxxxxx> wrote:
On 2010-09-17, contracer wrote:
Hi,
Please help me with this question:
a=dup
b=tape
How use this grep ?
grep $a_$b file.lis
The two variables you are using are $a_ and $b. Use braces to
separate the variable name from the underscore:
grep ${a}_$b file.lis
--
Chris F.A. Johnson, author <http://shell.cfajohnson.com/>
===================================================================
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Thanks a lot Mr. Johnson.
.
- References:
- grep with 2 variables
- From: contracer
- Re: grep with 2 variables
- From: Chris F.A. Johnson
- grep with 2 variables
- Prev by Date: Re: grep with 2 variables
- Next by Date: Re: packages: binary vs. source
- Previous by thread: Re: grep with 2 variables
- Index(es):