Shell scripting question
Paul Schmehl
pauls at utdallas.edu
Mon Sep 12 15:56:30 PDT 2005
--On Monday, September 12, 2005 13:17:05 -0700 David Kirchner <dpk at dpk.net>
wrote:
> 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
Thanks, David. That's exactly what I needed, and now that you've pointed
it out to me, I see (reading the specs) how that is it. I just didn't
understand what I was reading before you pointed it out.
Paul Schmehl (pauls at utdallas.edu)
Adjunct Information Security Officer
University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/ir/security/
More information about the freebsd-questions
mailing list