Bash: get length of string
20 December 2025 (Updated 20 December 2025)
#!/usr/bin/env bash
str="sajad"
echo "The length of the string '$str' is: ${#str}"
Tagged:
Bash recipes
#!/usr/bin/env bash
str="sajad"
echo "The length of the string '$str' is: ${#str}"