Re: grep with 2 variables



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.
.