I have a file with lines like
TEST=value
I would like to do a search and replace such that I replace the first token with its lower case equivalent. So the above would be transformed into
prefix/test —output value
I tried the below
perl -pi -e ’s/(.*)=(.*)/prefix\/lc($1) —output $2/g' .env
But evidently “lc” is being interpreted literally because the result is
prefix/lc(TEST) —output value