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

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

java - SmsManager sending message more than one -