remove last field from string

Hi everybody!

I want to cut the last field from string, can anybody help me??

String input:: /abc1/abc2/abc3

output:: /abc1/abc2

Regards,
Kiran

dirname /abc1/abc2/abc3

Try something like this:

[user@host ~]$ VAR="/abc1/abc2/abc3"; echo ${VAR%/*}
/abc1/abc2