我在C中有一个基本上移动BG中的文件的脚本,然后下载一个新文件并替换它。我想知道在发出命令时如何不回应命令。
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");
它会创建一个输出:
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:~# _
我不希望它显示wget日志。 只需回应“完成替换帖子!”
答案 0 :(得分:1)
system("wget -q http://mywebsite.com/post.php.txt -O /var/www/post.php");
来自manual:
-q
--quiet
Turn off Wget's output.