Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2013 10:28:10 -0500
From:      Tim Daneliuk <tundra@tundraware.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: check variable content size in sh script
Message-ID:  <5194FB0A.9090400@tundraware.com>
In-Reply-To: <5194F65F.6080503@a1poweruser.com>
References:  <5194F65F.6080503@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 05/16/2013 10:08 AM, Joe wrote:
> Hello
>
> Have script that has max size on content in a variable.
> How to code size less than 51 characters?
>

FOO="Some string you want to check length of"
FOOLEN=`echo $FOO | wc | awk '{print $3}'`

You can then use $FOOLEN in a conditional.




-- 
----------------------------------------------------------------------------
Tim Daneliuk     tundra@tundraware.com
PGP Key:         http://www.tundraware.com/PGP/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5194FB0A.9090400>