Find by regex and replace match to lowercase in Bash -
i replace contents of file match given regex lowercase equivalent. like:
grep -o '[^ ]*[a-z][^ ]*.png' file-21-05-2013.sql* | awk '{print tolower($0)}'
the line above finds strings in given file have @ least 1 uppercase character , prints lowercase equivalent.
i replace output of grep command output of whole command above
does make sense?
if using gnu system gnu sed has following extension:
\l turn replacement lowercase until \u or \e found,
the following command should need:
sed "s/\([^ ]*[a-z][^ ]*.png\)/\l\1/g" file-21-05-2013.sql*
Comments
Post a Comment