Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Created January 8, 2014 20:46
Show Gist options
  • Save coderofsalvation/8324304 to your computer and use it in GitHub Desktop.
Save coderofsalvation/8324304 to your computer and use it in GitHub Desktop.
prints out the length of a string (bash function)
# prints out the length of a string
# @param string input
function strlen()
{
[ -z "$1" ] && return 1
printf "%s\\n" "${#1}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment