Hi,
From the above output of df command I need to parse only 43G (available space) and display it.
root@localhost:> df -h /vol1/joy
[LEFT] Filesystem Size Used Avail Capacity Mounted on
/vol1/joy 180G 137G 43G 76% /backup
[/LEFT]
I am using the system command in the following way. Let me know if there is still an efficient way of doing it.
printf("Free space: ");
system("df /vol1/joy | awk '{print $3}' | tail -n 1");