Re: Need help with SED
Amarendra Godbole <[email protected]>
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
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 > > >