global scope of variable
- by shantanuo
The following shell scrip will check the disk space and change the variable "diskfull" to 1 if the usage is more than 10%
The last echo always shows 0
I tried the global diskfull=1 in the if clause but it did not work.
How do I change the variable to 1 if the disk consumed is more than 10%
#!/bin/sh
diskfull=0
ALERT=10
df -HP | grep -vE…