When I run
df -hl | grep '/dev/disk1' | awk '{sub(/%/, \"\");print $5}'
I'm getting the following error:
awk: syntax error at source line 1
context is
{sub(/%/, >>> \ <<< "\");}
awk: illegal statement at source line 1
I can't seem to find any documentation on awk sub.
df -hl | grep '/dev/disk1'
returns
/dev/disk1 112Gi 94Gi 18Gi 85% 24672655 4649071 84% /
As I understand, it should return the percentage of disk space used.