Reputation: 37018
I have this line in a small bash function:
if [ ${#$2} -lt 25 ]; then
But it gives me Bad substitution
on the ${#$2}
. What am I doing wrong there? I'm trying to get the length in characters of the second command line argument. How can I do this?
Upvotes: 2
Views: 90