Cross-Platform alternative to expr length When running some BASH scripts I had in my Linux box I noticed that expr length gives syntax error.

Manual pages doesn't seems to include any information about the length operator. Is it missing in Mac OS X?

What other cross-platform alternative can I use?
Instead of expr length 'keyword' you can use awk. An example would look like this echo 'keyword' | awk '{ print length }'

bounty:~ napcae$ echo 'keyword' | awk '{ print length }'  
7