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
网友评论