I an writing simple script in Bash, to check Linux file system disk usage on root file system and display a warning message if system is greater than 6%.
The commands are running in a terminal, however when I tried the if statement, I am getting this error on line 16
[: missing]'`
1 #!/bin/bash
2
3
4
5 clear
6 #checking for usage on the system and saving in a file usage1
7 df -h / >usage1
8
9 #display current use to the screen
10 clear
11 echo
12 awk '$5>6' usage1
13
14 #Creating variable to use in the awk if statemant
15 usage2= "awk '{print $5}'/home/peters/usage1 | tail -n1 |cut -c1"
16 #Building statemant
17 if ($usage2>6)
18 print "Warning file system greater than 6% !!"
19
20 exit 0