expr

HowTo : Find The Length Of a String or Variable in Bash

This short note shows how to find out the length of a string from the Linux command line, how to count the lengths of each line in a file and how to get the length of a string stored in a variable in Bash and then assign that calculated number of characters to another variable.