Horje
bash count elements in string Code Example
bash count elements in string
# Basic syntax:
YOUR_VAR=( $YOUR_VAR ) # convert the string to an array
echo ${#YOUR_VAR[*]} # use the standard bash syntax to get the length of arrays

# Example usage:
YOUR_VAR='some string with words'
YOUR_VAR=( $YOUR_VAR )
echo ${#YOUR_VAR[*]}
--> 4

# Note, to convert the array back to a string, use:
YOUR_VAR="${YOUR_VAR[*]}"




Shell

Related
how to kwno if my mac has intel 32 or 64 Code Example how to kwno if my mac has intel 32 or 64 Code Example
service account credentials gcp token Code Example service account credentials gcp token Code Example
brightness function not working problem in kali linux Code Example brightness function not working problem in kali linux Code Example
truffle.ps1 is not digitally signed Code Example truffle.ps1 is not digitally signed Code Example
git filter branch recursively Code Example git filter branch recursively Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
14