Shell scripting question

David Kirchner dpk at dpk.net
Mon Sep 12 13:17:07 PDT 2005


On 9/12/05, Paul Schmehl <pauls at utdallas.edu> wrote:
> How can I strip the leading character from the string so that I can test to
> see if it's zero?

This'll strip the 0, while leaving other numbers intact:

$ X=09
$ echo ${X#0}
9


More information about the freebsd-questions mailing list