2

My bash script keeps failing because it gets confused at the hyphen:

if [ ! -d "$openssl-1.0.1i"]; then ...

How do I escape it correctly?

Maroun
  • 91,013
  • 29
  • 181
  • 233

1 Answers1

4

It's not the hyphen, you must leave a space surrounding each argument in your test construct:

if [ ! -d "$openssl-1.0.1i" ]; then ..

Why do you have a $ before openssl? It's not a variable is it? If not, it should be just:

if [ ! -d "openssl-1.0.1i" ]; then ..
David C. Rankin
  • 75,900
  • 6
  • 54
  • 79