0

I'm trying to run the following:

bash -c "[[ -d foo ]] || { mkdir foo && echo create foo done }"

But I get following error:

bash: -c: line 1: syntax error: unexpected end of file

Why do I get above error? How can I fix it?

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
zwy
  • 139
  • 1
  • 7
  • 1
    try `...{ mkdir .... ; }` . (Note added `;` char). Good luck. – shellter Jul 08 '17 at 03:13
  • A solution should be added *as an answer*, not an edit to the question. You're allowed to add (and accept) your own answers. – Charles Duffy Jul 08 '17 at 03:32
  • 1
    btw, the problem had nothing at all to do with ssh -- you'd need that `;` even to do `[[ -d foo ]] || { mkdir foo && echo create foo done; }` successfully on your local machine. – Charles Duffy Jul 08 '17 at 03:32

0 Answers0