我想在控制台中保留 Bash 脚本输出的颜色,同时记录并将其回显到控制台。
当我使用以下代码运行脚本时,我在控制台中丢失了颜色。
LOG_FILE="Merge.log"
touch $LOG_FILE
exec > >(tee $LOG_FILE) 2>&1;
Run Code Online (Sandbox Code Playgroud)
以下是屏幕截图以明确说明:
屏幕一和屏幕二在脚本中禁用了日志记录(注释掉):
屏幕 1:
屏幕 2:
屏幕三和四在脚本中启用了日志记录:
屏幕 3:
屏幕 4:
我已经搜索了很多但找不到任何解决方案。谢谢。
操作系统:Ubuntu MATE 21.04
Bash 版本:5.1.4(1)-release (x86_64-pc-linux-gnu)
我已经从Cilynx 的 GitHub 存储库安装了 Realtek RTL88x2BU 驱动程序,使用 DKMS 安装在 Ubuntu MATE 19.04 内核 5.3.4(和更高版本 5.3.7)
驱动程序正常工作一周,然后突然完全停止检测 TP-Link Archer T3U AC1300 无线 USB 适配器。相同的适配器可以与其他 PC 正常工作。
This is how drivers were installed:
cd rtl88x2bu
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER}
sudo dkms add -m rtl88x2bu -v ${VER}
sudo dkms build -m rtl88x2bu -v ${VER}
sudo dkms install -m rtl88x2bu -v ${VER}
sudo modprobe 88x2bu
Run Code Online (Sandbox Code Playgroud)
那么我如何才能完全删除 RTL88x2BU 的所有先前版本(1.1、5.6.1 等)的内核模块?非常感谢。
我刚刚注意到,/usr/share/keyrings/我的 Ubuntu MATE 21.04 安装目录中有很多 Debian 密钥环 GPG 文件(已定期从以前的版本升级)。
$ ls -lsh /usr/share/keyrings/
total 32M
12K -rw-r--r-- 1 root root 8.5K Mar 26 16:41 debian-archive-bullseye-automatic.gpg
12K -rw-r--r-- 1 root root 8.6K Mar 26 16:41 debian-archive-bullseye-security-automatic.gpg
4.0K -rw-r--r-- 1 root root 2.4K Mar 26 16:41 debian-archive-bullseye-stable.gpg
8.0K -rw-r--r-- 1 root root 8.0K Mar 26 16:41 debian-archive-buster-automatic.gpg
8.0K -rw-r--r-- 1 root root 8.0K Mar 26 16:41 debian-archive-buster-security-automatic.gpg
4.0K -rw-r--r-- 1 root root 2.3K Mar 26 16:41 debian-archive-buster-stable.gpg
56K -rw-r--r-- 1 …Run Code Online (Sandbox Code Playgroud)