Re: how to check the length of a variable in ksh?

From: Bill Thompson (bill.thompson@GOODYEAR.COM)
Date: Thu Nov 21 2002 - 12:50:41 EST


if (( $(expr $i : ".*") > 5 ))
then
        do something
fi

Bill Thompson
Sr UNIX Systems Administrator
The Goodyear Tire & Rubber Co.

Contains Confidential and/or Proprietary Information
May Not Be Copied or Disseminated Without Express Consent of The Goodyear
Tire & Rubber Company.

AIX-L Archives: http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2

----- Original Message -----
From: "Clifton, Pablo" <Pablo.Clifton@BCBSFL.COM>
Newsgroups: bit.listserv.aix-l
To: <aix-l@Princeton.EDU>
Sent: Thursday, November 21, 2002 12:01 PM
Subject: how to check the length of a variable in ksh?

> Hi-
>
> Anyone know how I can check in a korn shell script:
>
> if [[ length of variable $i is > 5 characters ]]
> then
> do something
> fi
>
> thanks,
> -pablo
>
> --
> Pablo Clifton
> UNIX Tech Services
>
>
>
>
> Blue Cross Blue Shield of Florida, Inc., and its subsidiary and
> affiliate companies are not responsible for errors or omissions in this
e-mail message. Any personal comments made in this e-mail do not reflect
the views of Blue Cross Blue Shield of Florida, Inc.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:22 EDT