1.

Solve : How to run sed.exe in Windows10?

Answer»

On BSD, I've been running runsed with sedscr for many years.

The sedscr would have a line like s/abc/ABC/
The runsed script I'll paste below. The command would be runsed filename

I just don't KNOW how to get sed.exe to work. The main problem is SETTING the permissions in Window10. I try right-clicking the sed icon on my desktop and clicking Run as administrator but still does not work.

And I am hoping once that is cleared up, a command like this will work at DOS command line: sed s/abc/ABC/ filename
And beyond that: sed s/abc/ABC/ *.html

Is there hope?

for x
do
echo "EDITING $x: \c"
if test "$x" = sedscr; then
        echo "Not editing sedscript!"
elif test -s $x; then
        sed -f sedscr $x > /tmp/$x
        if test -s /tmp/$x
        then
        cmp -s $x /tmp/$x && echo "FILE not changed: \c"; cp /tmp/$x $x;echo "Done."
        else
        echo "Sed produced an EMPTY file -- check sedqscript"
        fi
else
        echo "original file in empty"
fi
done
echo "all done."


On Windows 10 Your best bet is to run WSL which will provide access to bash and GNU sed on your Windows file system

https://docs.microsoft.com/en-us/windows/wsl/install



Discussion

No Comment Found