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
Post a Comment