[ubuntu] set timezone by command

2017-07-30  本文已影响10人  JellyL

Step 1: use expect instead of bash, install exect and tzdata

sudo apt-get install expect tzdata

Step 2: create a sh file

#!/usr/bin/expect

spawn sudo dpkg-reconfigure tzdata
expect "Geographic area:"
send "12\r"
expect "Time zone:"
send "4\r"
interact
上一篇下一篇

猜你喜欢

热点阅读