Hi all,
I'd suggest something like:
space_available=$(df -k $1|awk '!/Filesystem/&&/%/{print $(NF-2)}')
1. removes excessive piping (passing output from grep to awk is doubtful)
2. it is immune from line-break after FS name
Cheers,
Petr
2009/1/5 yuan.fan <Yuan.Fan at sun.com>:
> sam.chen ??:
>> Hi,
>>
>> when i configure NICDRV ,and checkenv script a error message:
>> checkenv: ce_disk_space(/var 2000000)
>> /opt/SUNWstc-checkenv/bin/checkenv[237]: .: ce_disk_space: line 58:
>> 72%: more tokens expected
>> checkenv: ce_disk_space(/var 2000000 delphix-v5)
>> delphix-v5 is alive
>> Result: FAIL
>>
>>
>> and i just modify ce_disk_space 58 lines, change:
>> space_available=`df -k $1 | \
>> grep -v Filesystem | awk '{print $4}'`
>> to
>> space_available=`df -k $1 | \
>> grep -v Filesystem | awk '{print $3}'`
>>
>> everything is ok. i think this is scripts bug. $4 will print percent
>> counter, and $3 is avaliable disk.
>>
>> please confirm it.
>>
>> sam.chen
>>
> Thanks for your suggestions,We will double check it.If you find any
> issues,please cc "NICDRV-interest at sun.com" alias.
>
> thanks very much.
>
> -yuan.fan
> _______________________________________________
> testing-discuss mailing list
> testing-discuss at opensolaris.org