• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 938
  • Last Modified:

access shell variables in egrep

Hi,

I want to remove any lines in the report that have the value of $curver and store in results..

This is not working:

cat report | egrep -v $curver > results

I've googled for ages on this.. not very experienced with shell scripting.

Anyone know how this can be done?

Regards,

Kevin
0
kmcghee
Asked:
kmcghee
1 Solution
 
omarfaridCommented:
try

cat report | egrep -v "$curver" > results

OR

eval cat report | egrep -v "$curver" > results

Since $curver might have spce(s) in it.
0
 
kmcgheeAuthor Commented:
doh!  it was a rogue space causing the issues.. thanks
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now