0

I am getting the error [: missing ]'` when running the below line in bash.

if [ ! -f "$file"]; then
    echo "File not found!"
fi
Cyrus
  • 77,979
  • 13
  • 71
  • 125
Mike C.
  • 1,507
  • 2
  • 16
  • 39

1 Answers1

2

change

[ ! -f "$file"]

to

[ ! -f "$file" ]

Change summary: added space before ]

Tushar
  • 13,804
  • 1
  • 24
  • 44