Re: seeking thru a string in a shell script
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Wed, 17 Jan 2007 18:50:54 -0500
On 2007-01-17, Chris the Hunter wrote:
expr length $str
Didn't work at my box, but thanks all the same
Probably because the variable should be quoted:
expr length "$str"
It's unlikely that a Linux distro would have an old version of expr
without the length operator.
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
.
- Follow-Ups:
- Re: seeking thru a string in a shell script
- From: Chris the Hunter
- Re: seeking thru a string in a shell script
- References:
- seeking thru a string in a shell script
- From: Chris the Hunter
- Re: seeking thru a string in a shell script
- From: noi
- Re: seeking thru a string in a shell script
- From: Chris the Hunter
- seeking thru a string in a shell script
- Prev by Date: Re: sequential numbering from in script
- Next by Date: Re: seeking thru a string in a shell script
- Previous by thread: Re: seeking thru a string in a shell script
- Next by thread: Re: seeking thru a string in a shell script
- Index(es):
Relevant Pages
|