美文网首页
[ubuntu] set timezone by command

[ubuntu] set timezone by command

作者: JellyL | 来源:发表于2017-07-30 17:14 被阅读10次

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

相关文章

网友评论

      本文标题:[ubuntu] set timezone by command

      本文链接:https://www.haomeiwen.com/subject/oahklxtx.html