Use of square brackets is necessary in bash for if statements.
The basic syntax of if..then statement is:
#!/bin/bash
if [ condition ]
then
<commands>
fi
If you have many if statements(nested if) inside your script,then with proper indenting...
See more
Download the Study24x7 App, so you can connect and collaborate.