Batch search and replace
Someone has given me a website that has a large amount of absolute links on it (200+ pages) and I'm looking for a way to do a search and replace on all files to replace these absolute links with relative ones...
Can anyone suggest a start point for me? I do know a little bash scripting and a little C++ but i haven't the slightest idea where to start... |
Since html pages are nothing but text files, you might be able to do what you want with a shell script using 'sed' to make the changes.
Something like sed -e 's/\/absolute\/directory/..\/directory/g' inputfile.html >outputfile.html Google for 'sed', and/or do a 'man sed' on your system. |
Thanks for that Padma, i got it :D
The more i use linux the more i love it |
All times are GMT -5. The time now is 07:46 AM. |