相关疑难解决方法(0)

MOTD 中没有颜色

我最近买了一个 Raspberry Pi,并开始玩它。更改我的 MOTD(包括颜色)后,颜色代码将作为原始文本出现而不是执行。

我在 Mac 终端中通过 SSH 连接到我的 Raspberry Pi。我也直接通过 Raspberries 命令行尝试过。我如何允许颜色?

下面是失败的 MOTD 的屏幕截图:

MOTD 颜色错误

我正在编辑的文件是“/etc/motd”。我正在用“纳米”编辑它。

代码如下:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

#!/bin/bash
echo "$(tput setaf 2)
   .~~.   .~~.
  '. \ ' ' / .'$(tput setaf 1)
   .~ .~~~..~.
  : .~.'~'.~. :
 ~ ( …
Run Code Online (Sandbox Code Playgroud)

colors ssh terminal motd raspberry-pi

3
推荐指数
1
解决办法
3902
查看次数

标签 统计

colors ×1

motd ×1

raspberry-pi ×1

ssh ×1

terminal ×1