Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定の正規表現に一致するファイルのすべての内容を、対応する小文字に置き換えたいと思います。お気に入り:
grep -o '[^ ]*[A-Z][^ ]*.png' file-21-05-2013.sql* | awk '{print tolower($0)}'
上記の行は、少なくとも 1 つの大文字を含む特定のファイル内のすべての文字列を検索し、対応する小文字を出力します。
grep コマンドの出力を上記のコマンド全体の出力に置き換えたい
それは理にかなっていますか?
sed -nr '/^.*\b(\w*[A-Z]\w*\.png).*$/{s//\1/;s/.*/\L\0/;p}' file