Variable comparison bash

I want to set a variable to use for a comparison that contains special characters . " / and aswell as quotes within the string it has quotes at the outside. It's the filter field in multipath


If  [[ ' grep -v '#'  | grep field .............' == "$VAR" ]]; then

Ps sorry cant get backticks on this ipad

I can see with set -x that the comparison look identical but I think there may be some hidden chars - I guessed newline but still no joy. Any idea how to view any hidden chars with echo or something else ?
Who is Participating?
omarfaridConnect With a Mentor Commented:
you can pipe the output to command od
lolaferrariAuthor Commented:
Ooh thanks but I don't know od
ozoConnect With a Mentor Commented:
grep -v '#'  | grep field ............ | od -a
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.