linux shell script 通过管道执行 sudo 权限:

echo "password" | sudo command, 事例:

  1 # !/bin/bash
  2 echo "password" | sudo chown john:john aa



Logo

更多推荐