2017/09/08

Shell Script sudo自動輸入密碼

透過STDIN or expect即可實現


#!/bin/bash
#-S = stdin

echo "password" | sudo -S -y apt-get update