Question

I have a script in C that basically moves files in the BG, then downloads a new file and replaces it. I want to know how to not Echo the command when it is being sent out.

IE:

system("mv /var/www/post.php /var/www/oldstuff/post2.php");
system("wget http://mywebsite.com/post.php.txt -O /var/www/post.php");

It creates an output like:

root@localhost:~# ./replace
--2014-03-03 19:58:18--  http://website.com/post.php.txt
Connecting to 46.19.143.250:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 34643 (34K)
Saving to: `/post.php.txt'

100%[=====================================================================================>] 34,643      --.-K/s   in 0s      

2014-03-03 19:58:18 (320 MB/s) - `/post.php.txt' saved [34643/34643]
Finished Replacing Post!
root@localhost:~# _

I dont want it to show the wget log. Just echo out "Finished Replacing Post!"

No correct solution

OTHER TIPS

system("wget -q http://mywebsite.com/post.php.txt -O /var/www/post.php");

From the manual:

-q
--quiet
    Turn off Wget's output.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top