Shell Script for adding base_url to the php files
I have a website setup in which there are a lot of files mostly php. But in this i am calling the files as say /model/login/......
I want to r开发者_JAVA技巧ename all such occurences as $base_url/model/login/....
How can I approach the problem or where can I get the tutorials for the same.
sed can do this trivially, provided you don't use the path for anything else in the code.
sed -i 's!/model/login/!$base_url&!g' foo.php
精彩评论