#!/usr/bin/env bash s="hello" # ${#var} expands to the length of the value echo "length is ${#s}"
${#s} gives the character count