sending a sed command from web deletes file content

Hello:

I am being faced with migrating my website to a Windows server, and I am experiencing a number of issues, the current one is running a “sed” command to modify a shell script, which in exchange then runs other tasks.

The Windows server has cygwin installed, when I run the sed command manually, it works correctly, but when the website requests the same command the output file is cleared, leaving it blank. Which tells me that the sed command does run, but it is not written.

The section that the sed command modifies is set by a variable, therefore, the code looks like this…

<?php $Mplayer = $_GET["Mplayer"]; $command = $_GET["radio"]; $selRadio = $command; $subset1 = "sed -e 's/localhost/"; $subset2 = "/g' "; $subset3 = $command." > ".$command."1".".sh"; $final = $subset1.$Mplayer.$subset2.$subset3; $finalLink= "./".$command."1".".sh"; exec($final); exec($finalLink); Any suggestions or some light in the right direction will be greatly appreciated!! Kind regards HT
Sponsor our Newsletter | Privacy Policy | Terms of Service