![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mget * (obtein files from current directory but not the files form sub-directories) | Peter321 | Shell Programming and Scripting | 0 | 03-12-2009 11:59 AM |
| Merge files of differrent size with one field common in both files using awk | shashi1982 | Shell Programming and Scripting | 2 | 03-03-2009 07:12 AM |
| I need a script to find socials in files and output a list of those files | NewSolarisAdmin | Shell Programming and Scripting | 1 | 02-19-2009 01:01 PM |
| Find duplicates from multuple files with 2 diff types of files | ricky007 | Shell Programming and Scripting | 2 | 03-04-2008 01:46 PM |
| text files, ASCII files, binary files and ftp transfers | Perderabo | Answers to Frequently Asked Questions | 0 | 04-08-2004 05:25 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
sed has zeored my files. Help me with sed please
i made a script to update a lot of xml files. to save me some time. Ran it and it replaced all the the files with a 0kb file. The problem i was having is that I am using sed to change xml node <doc_root>. The problem with this is it has a / in the closing xml tag and the stuff inside will also have a bunch of / because it is a file path. so i am using sed and was hoping this would work: Code:
sed 's/<doc_root><\/doc_root>/<doc_root>\/'$i'\/web<\/doc_root>/g' $my_file > $my_file Is my problem in the regex or is it because I am using $my_file > $my_file ? do i need to copy it to a temp file first the mv it to old file? Or if its the regex can someone help with that Here is the search string Code:
<doc_root></doc_root> Here is a typical replace string Code:
<doc_root>/domain.co.uk/web</doc_root> where the daomin.co.uk will be an argument from a for loop i.e $i Please help before my boss gets angry with me
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|