Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Created January 9, 2014 17:42
Show Gist options
  • Select an option

  • Save coderofsalvation/8338500 to your computer and use it in GitHub Desktop.

Select an option

Save coderofsalvation/8338500 to your computer and use it in GitHub Desktop.
returns length of a string
# returns length of a string
# @param string input
# usage: strlen "foo" (output: 3)
# length="$( strlen "foo" )"; echo "$length" (output: 3)
strlen(){
echo "${#1}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment