ファイルを検索して、検索する文字列の前に行を追加する方法を見つけようとしています
xxx = text() // '=' folowed by space or not then 'text()'
見つかった場合:
この行の前に追加
new text
言い換えれば、私はこれが欲しい
xxx = text()
これになる:
new text
xxx = text()
私はこれを試しました
find /var/www/users/ \( -name '*.py' \) -type f -exec sed -i 's|\s+\=\s+\text()|new text|i' {} \;