20220 is not the free space; it's the size of the file system. If you want to get that
number into a variable, do
$ N=`df -k /pt | awk 'NR == 2 {print $2}'`
If you want to get the available space, 70336, into a variable do
$ N=`df -k /pt | awk 'NR == 2 {print $4}'`
---Robert
_______________________________________
>
> How to extract actual free space value out of df output using shell
> and sed only? Say on Linux
> #df -k /pt
> Filesystem 1k-blocks Used Available Use% Mounted on
> /dev/hda5 202220 121144 70336 63% /
>
> I want to assign 202220 to some variable to compare with treshold.
>
> Thanks.