Using grep $ sign help?

hi so I was debugging some scripts and I ran into a problem that did not come up before

grep -n "$variable"$ ./file.txt

I figured the second $ is meant to reference the end of the line but this gave me trouble in my c shell. anyone know whats wrong here or how to rewrite this???

Thank you!

Try:

grep -n "$variable"'$' ./file.txt
1 Like

thanks! that was really simple wow