小编Cra*_*der的帖子

Cinnamon Desktop - 单击菜单-> 关机没有真正的按钮选项?

当我单击菜单然后关机(退出)时,我得到以下对话框:

______________________________
| Session                   x |
______________________________
|                             |
| Shutdown this system now?   |
| __________                  |
| |Cancel  x|                 |
-------------------------------
Run Code Online (Sandbox Code Playgroud)

(似乎在关闭对话框打开时我无法按打印屏幕,因此我无法为此问题提供屏幕截图。)

为什么我只有一个取消按钮,我该如何解决这个问题,因为过去有关机、重启、注销?

shutdown menu cinnamon

10
推荐指数
1
解决办法
1万
查看次数

在 Bash 中使用 Expect 来设置初始的“postgres”用户密码?

按照这里的教程: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)

bash password postgresql

4
推荐指数
1
解决办法
1568
查看次数

标签 统计

bash ×1

cinnamon ×1

menu ×1

password ×1

postgresql ×1

shutdown ×1