当我单击菜单然后关机(退出)时,我得到以下对话框:
______________________________
| Session x |
______________________________
| |
| Shutdown this system now? |
| __________ |
| |Cancel x| |
-------------------------------
Run Code Online (Sandbox Code Playgroud)
(似乎在关闭对话框打开时我无法按打印屏幕,因此我无法为此问题提供屏幕截图。)
为什么我只有一个取消按钮,我该如何解决这个问题,因为过去有关机、重启、注销?
按照这里的教程:http : //www.unixmen.com/install-postgresql-9-4-phppgadmin-ubuntu-14-10/
我正在用 bash 编写 PostgreSQL 安装脚本,但在设置初始用户密码时遇到问题。
按照本部分的教程,我们有:
# Login to postgresql prompt:
sudo -u postgres psql postgres
# .. and set postgres password with following command:
postgres=# \password postgres
Enter new password:
Enter it again:
postgres=# \q
Run Code Online (Sandbox Code Playgroud)
这很好,但我想从 Bash 脚本设置这个密码,并且这种类型的任务通常可以使用 Expect 的一种方式:
# Build the command into a variable so that we can run it later
PSQL_QUERY=$(expect -c "
set timeout 10
spawn -u postgres psql postgres -c '\\\password postgres'
expect \"Enter new password:\"
send \"password\r\"
expect …Run Code Online (Sandbox Code Playgroud)