Hi,
can any body tell me what is the function to get the length of a string in unix?I have used functions like len,length,strlen, but they are not working.
cheers
RRK
Hi,
can any body tell me what is the function to get the length of a string in unix?I have used functions like len,length,strlen, but they are not working.
cheers
RRK
var="test";
echo "length = ${#var}";
perl -e 'while (<>) { chomp; print length($_) . "\n" }' filename
awk '{ print length }' filename
var="test"
echo $(($(echo $var| wc -c )-1))