Convert a capital case string to camel case using shell script -


i trying convert capital case word camel case using shell script. e.g. projectassignment should converted projectassignment.

echo "project assignment" | sed 's/.*/\l&/; s/[a-z]*/\u&/g' 

this produces output : project assignment

on similar lines, want convert projectassignment projectassignment.

you can gnu-sed:

s='projectassignment' echo "$s" | sed 's/^[a-z]/\l&/'  projectassignment 

^[a-z] match first letter if uppercase.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -