Re: Need help with SED
kn srivastava <[email protected]>
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <CABOZqg76r0tKHHhVeVgT_P_sTsKoisa5HdKpaGxSXr-4ptCOvg@mail.gmail.com> |
sed: cannot rename ./sedDOSSUX: File exists I get the above message. Regards Kailash On Fri, Feb 15, 2013 at 5:24 PM, Amarendra Godbole <[email protected]> wrote: > I place editing can be problematic which is why classic sed does not touch the original file. This is a gnu extension (a move to make it more user friendly but broken in my opinion). So you should have gnu sed on windows. Secondly make sure the -i switch is not broken for your version. Thirdly tell us what does it complain and maybe I can help further. > > -ag > > -- > sent via 100% recycled electrons from my mobile command center. > > On Feb 15, 2013, at 2:51 AM, "goshainganj" <[email protected]> wrote: > >> @echo off >> dir /b /s | find ".pscx" > mydir.txt >> pushd . >> for /F "delims==" %%a in (mydir.txt) do ( >> echo "%%a" >> sed -i "s/1.0101/1.0400/g" "%%a" > junk.txt >> move junk.txt "%%a" >> ) >> popd >> del mydir.txt >> ------------------- >> >> I wrote the above code to change 1.0101 to 1.0400 in all .pscx files in all directories from where I am executing this batch file. >> >> I read SED manual and it said -i option would directly change .pscx files but it complained. So I directed the output to junk.txt. I wanted to move junk.txt back to .pscx file. It is this part of the above script that's not working. >> >> Any suggestions why -i is not working and how I can make the above to work? >> >> Thanx >> Kailash >> >> >> >> >> ------------------------------------ >> >> -- >> Yahoo! Groups Links >> >> >>