grepping last word of output
I am trying to write a script in perl.
It executes df -h and reads the input :
/dev/sda7 688M 45M 608M 7% /scratch
/dev/sda3 981M 17M 915M 2% /tmp
/dev/sda8 494M 282M 187M 61% /usr/vice/cache
/dev/sda5 981M 69M 862M 8% /var
I want to get input in an array ,
where it contains only last field namely -> /scratch, /tmp, /usr/vice/cache, /var
@arr = <xyz>;
takes the whole line as input and I can parse it. But when partition names vary from machines to machines, that ofcourse is not a good idea.
Kindly suggest what to do ???