1. 程式人生 > >Three methods about calculate string length

Three methods about calculate string length

echo then lin ash string ldb dbo ech expr

#! /bin/bash
for i in I am oldboy linx welcome to our training ;do
if [ echo ${#i} -ge 6 ];then
echo $i
fi
done

for i in I am oldboy linx welcome to our training ;do
if [ echo $i|wc -L -ge 6 ];then
echo $i
fi
done

for i in I am oldboy linx welcome to our training ;do
if [ expr length $i -ge 6 ];then

echo $i
fi
done

Three methods about calculate string length