Regular expression and tools
I hope I'm posting this message to the correct group.
I need to find the amount of disk space currently occupied in percentages.
This is relatively easy:
/bin/df -k /
It outputs the following:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 60476036 9084940 48319068 16% /
From within a bash shell script, I have to get the number 16.
Meaning, I have to look for digits before a percent sign.
I know I have to use regular expressions and something called a backreference but
I haven't been able to accomplish that.
Please provide good links if you know about and a code sample for a solution if possible.