Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • [ -z $var ] checks if the variable var is set or not. In your case there's a string in var so it is always set. -- BTW add double quotes when using unary comparison ([ ... ]). Commented Apr 11, 2015 at 23:02
  • ... so you need double quotes to have the value of $doFileExist interpreted, otherwise it will just check if the string $doFilesExist instead of its value: [ -z "$doFilesExist" ] Commented Apr 11, 2015 at 23:03
  • By the way, instead of editing the post saying "hey this works" you can [also] mark as accepted the answer that solved your issue. This way it is clear to future visitors that your problem is solved to future readers Commented Apr 11, 2015 at 23:09
  • 1
    sorry about that, I will make sure to select an answer in future Commented Apr 11, 2015 at 23:23