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.
名前が付けられた 30 個のファイル ( db01.php から db30.php まで)
この行を含める
require_once('config.php');
追加または置換したい
require_once('../new/config.php');
sed を使用してこれらの 30 個のファイルを一度に編集する方法
sed -i 's/\(require_once(.\)\(config\.php.);\)/\1..\/new\/\2/' db*.php
sed -i "s/\(require_once('\)\(.*\.php\)\(');\)/\1..\/new\/\2\3/" db*.txt