0

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

if [ ! -f "$file"]; then
    echo "File not found!"
fi
Cyrus
  • 84,225
  • 14
  • 89
  • 153
Mike C.
  • 1,761
  • 2
  • 22
  • 46

1 Answers1

2

change

[ ! -f "$file"]

to

[ ! -f "$file" ]

Change summary: added space before ]

Tushar Gupta
  • 15,504
  • 1
  • 29
  • 47