How can I get the length of all arguments given to a function in bash? -
i'd length of string when use "$*"
in function.
i tried:
echo ${#"$*"}
and
echo ${#"*"}
both gave me bad substitution error.
i don't think can in single command. however, seems work:
#!/bin/bash a="$@" echo "${#a}"
Comments
Post a Comment