Skip to main content
2 of 3
added 222 characters in body
Lambert
  • 12.8k
  • 2
  • 28
  • 35

Most simple method is to use single quotes on the right hand side:

if [ "$line" == '#orb_plugins = ["local_log_stream", "iiop_profile", "giop", "iiop"];' ]

This way the string to be matched is interpreted literally.

If you prefer using double quotes, you do not have to escape the brackets ([]), but only the double quotes (""):

if [ "$line" == "#orb_plugins = [\"local_log_stream\", \"iiop_profile\", \"giop\", \"iiop\"];" ]
Lambert
  • 12.8k
  • 2
  • 28
  • 35