check variable content size in sh script
markham breitbach
markham_breitbach at ssimicro.com
Thu May 16 15:49:11 UTC 2013
something like this:
#!/bin/sh
if [ $# -lt 1 ] ; then
echo "put a nickel in the slot, pal!"
exit 1;
fi
NUMCHARS=`echo $1 | wc -m`
if [ $NUMCHARS -lt 51 ] ; then
echo "You input "$NUMCHARS" characters."
exit 0
else
echo "whoa sailor I can't take all that!"
exit 1
fi
On 13-05-16 9:08 AM, Joe wrote:
> Hello
>
> Have script that has max size on content in a variable.
> How to code size less than 51 characters?
>
> Thanks
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions
mailing list