echo “password” | sudo -S netstat -tlnp
The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device.
源: http://bbs.csdn.net/topics/350068385
echo “password” | sudo -S netstat -tlnp
The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device.
源: http://bbs.csdn.net/topics/350068385