Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Passing single quotes to grep

$
0
0
Hi,

I have a grep command which searches if a particular word ends in a pattern
Code:

grep 'ee\>' *
The above command searches for any word that ends with ee across files and works as expected.

I need to parametrize ee and run the command

so I tried the following but none work
Code:

A=ee
grep '${A}\>' *
grep '"${A}"\>' *
A="'EE\>'"
grep $A *

Any ideas, on how I need to execute the grep?

Viewing all articles
Browse latest Browse all 16232

Trending Articles