如果我diff -q
在两个文件上运行并且它们是相同的,则生成的退出代码echo $?
是0
; 如果文件不同,则退出代码为1
. 这是为什么?第diff
一个成功而第二个失败的方式是什么?
根据我对http://mywiki.wooledge.org/BashGuide/TestsAndConditionals 的阅读和有限的理解,我使用了“成功”和“失败”这两个术语:
- 退出状态
每个命令在终止时都会产生一个退出代码。
任何启动它的应用程序都使用此退出代码来评估
是否一切正常。此退出代码类似于
函数的返回值。它是一个介于 0 到 255(含)之间的整数。约定
规定我们使用 0 表示成功,使用任何其他数字表示
某种类型的失败。具体数字完全是特定于应用程序的,
用于提示究竟出了什么问题。
我应该man diff
把开发人员使用的约定清楚地读到最后。
每隔几天我就会收到这些锁定服务器的错误。
[501.882940] print_req_error: I/O error, dev fd0, sector 0
[504.338961] print_req_error: I/O error, dev fd0, sector 0
[504.738984] print_req_error: I/O error, dev fd0, sector 0
[509.250929] print_req_error: I/O error, dev fd0, sector 0
[509.898921] print_req_error: I/O error, dev fd0, sector 0
[510.334916] print_req_error: I/O error, dev fd0, sector 0
[517.714867] print_req_error: I/O error, dev fd0, sector 0
[520.118801] print_req_error: I/O error, dev fd0, sector 0
[520.618864] print_req_error: I/O error, dev fd0, sector 0
[521.047029] print_req_error: I/O error, dev fd0, sector …
Run Code Online (Sandbox Code Playgroud) 我注意到,当我拔掉笔记本电脑的插头,或合上/打开盖子时,我的无线连接每次都会掉线。
我将其追踪到pm-powersave
,并使其停止,见下文。
这也可能导致重复请求网络密码。
我使用 Ubuntu 16.04 LTS 。HPLIP 3.16.3 附带了这个。我购买了一台新打印机 LaserJet Pro MFP M130nw,它至少需要 HPLIP 3.16.11。
\n我从 HP Developer 网站下载了自动安装程序(.run 文件)Download HPLIP 3.20.5。然后运行自动安装程序。
\n该过程进展顺利,直到 HP-PLUGIN 失败 - 请参阅下面的日志
\nHP Linux Imaging and Printing System (ver. 3.20.5)\nPlugin Installer ver. 3.0\nCopyright (c) 2001-18 HP Development Company, LP\nThis software comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to distribute it\nunder certain conditions. See COPYING file for more details.\nPlug-in version: 3.20.5\nInstalled HPLIP version: 3.20.5\nNumber of files to install: 64\nPlugin installation …
Run Code Online (Sandbox Code Playgroud) Hit:1 http://si.archive.ubuntu.com/ubuntu artful InRelease
Hit:2 http:// si.archive.ubuntu.com/ubuntu artful-updates InRelease
Hit:3 http:// si.archive.ubuntu.com/ubuntu artful-backports InRelease
Hit:4 http:// download.virtualbox.org/virtualbox/debian xenial InRelease
Err:3 http:// si.archive.ubuntu.com/ubuntu artful-backports InRelease
Splitting up /var/lib/apt/lists/si.archive.ubuntu.com_ubuntu_dists_artful-backports_InRelease into data and signature failed
Hit:5 https:// updates.signal.org/desktop/apt xenial InRelease
Get:6 http:// security.ubuntu.com/ubuntu artful-security InRelease [78,6 kB]
Hit:7 http:// security.ubuntu.com/ubuntu artful-security/main amd64 Packages
Ign:7 http:// security.ubuntu.com/ubuntu artful-security/main amd64 Packages
Hit:8 http:// security.ubuntu.com/ubuntu artful-security/main i386 Packages
Hit:9 http:// security.ubuntu.com/ubuntu artful-security/main Translation-en
Hit:10 http:// security.ubuntu.com/ubuntu artful-security/main amd64 DEP-11 Metadata
Hit:11 http:// security.ubuntu.com/ubuntu artful-security/main DEP-11 64x64 …
Run Code Online (Sandbox Code Playgroud) http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Run Code Online (Sandbox Code Playgroud) 硬盘驱动器表现出超级损坏。欢迎任何帮助...我们无法物理访问这台计算机。我们可以通过ssh远程解决这个问题。
$ fsck -p -f
fsck from util-linux 2.31.1
/dev/mapper/ubuntu--vg-root: recovering journal
fsck.ext4: unable to set superblock flags on /dev/mapper/ubuntu--vg-root
/dev/mapper/ubuntu--vg-root: ********** WARNING: Filesystem still has errors **********
$ reboot
Failed to open /dev/initctl: No such device or address
Failed to talk to init daemon.
# Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-38-generic x86_64)
Run Code Online (Sandbox Code Playgroud) 1 Time(s): audit: type=1400 audit(1473854574.089:113): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/cups/backend/cups-pdf" pid=31430 comm="apparmor_parser"
1 Time(s): audit: type=1400 audit(1473854574.089:114): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=31430 comm="apparmor_parser"
1 Time(s): audit: type=1400 audit(1473854574.089:115): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=31430 comm="apparmor_parser"
Run Code Online (Sandbox Code Playgroud)
我应该担心吗?
我正在运行 Ubuntu 14.04.5 LTS(GNU/Linux 4.4.0-36-generic x86_64)
我试图traceroute
用于我的网络项目。但是每当我尝试安装traceroute
它时都会显示
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt--fix-broken install' to correct these.
The following packages have unmet dependencies:
code : Depends: libgconf-2-4 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Run Code Online (Sandbox Code Playgroud)
然后我点击了这个链接。但它再次没有成功安装并显示,
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' …
Run Code Online (Sandbox Code Playgroud) sudo apt-get install kubuntu-restricted-extras
Run Code Online (Sandbox Code Playgroud)
似乎运行良好
sudo /usr/share/doc/libdvdread4/install-css.sh
Run Code Online (Sandbox Code Playgroud)
给出:
sudo: /usr/share/doc/libdvdread4/install-css.sh: command not found
Run Code Online (Sandbox Code Playgroud)
已运行 sudo apt-get update 多次
怎么修?如何安装 libdvdread4?
michaeleric@michaeleric-Inspiron-1750:~$ sudo apt-get install libdvdread4
[sudo] password for michaeleric:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libdvdread4 is already the newest version (5.0.3-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
michaeleric@michaeleric-Inspiron-1750:~$ sudo /usr/share/doc/libdvdread4/install-css.sh
sudo: /usr/share/doc/libdvdread4/install-css.sh: command not found
michaeleric@michaeleric-Inspiron-1750:~$
Run Code Online (Sandbox Code Playgroud)
===========================================
sudo apt install libdvdcss2 libdvdread4 libdvdnav4 ubuntu-restricted-extras
Run Code Online (Sandbox Code Playgroud)
似乎安装
michaeleric@michaeleric-Inspiron-1750:~$ sudo /usr/share/doc/libdvdread4/install-css.shsudo: …
Run Code Online (Sandbox Code Playgroud) 14.04 ×1
18.04 ×1
apparmor ×1
apt ×1
bash ×1
cups-lpd ×1
filesystem ×1
hplip ×1
io ×1
ip-address ×1
kubuntu ×1
libraries ×1
networking ×1
ppa ×1
traceroute ×1
wireless ×1