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
  • 94,125
  • 30
  • 188
  • 241

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
  • 81,885
  • 6
  • 58
  • 85