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

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -