Skip to main content
1 of 3
cuonglm
  • 158.2k
  • 41
  • 342
  • 420

You need to use {list;} instead of (list):

if ! { [ -f file1 ] && [ -f file2 ] && [ -f file3 ]; }; then
  : do something
fi

Both of them are Grouping Commands, but {list;} execute commands in current shell environment.

Note that the ; in {list;} is need to delimit the list from } reverse word, you can use other delimiter as well.

cuonglm
  • 158.2k
  • 41
  • 342
  • 420