Syntax Question for scripting - if conditions
I'm getting a syntax error with this and was hoping for some help please:
if [[ -e $4 ] && [ "$overwrite_flag" != 0 ]] || [ -!e $4 ] I'm trying to say: (If file ($4) exists AND the overwrite flag is set) OR (If the $4 file does NOT exist) THEN .... Can someone please tell me what i'm doing wrong? |
I would put the last condition first. The problem is that you can't really nest []'s
So maybe this: Code:
if [-!e $4 ] || [ -e $4 ] && [ "$overwrite_flag" != 0 ] |
Code:
#!/bin/sh |
All times are GMT -5. The time now is 09:38 PM. |