至少在基于 Debian 的系统下,debianutils包中有一个run-parts
实用程序,可用于各种脚本。例如在 /etc/X11/Xsession.conf 中。它将运行在目录中找到的所有可执行文件。为什么需要运行部件而可以与选项或实用程序一起使用?另外,什么是可执行文件?看起来它不是简单地检查文件权限:find
-perm
test
run-parts
# run-parts --list --lsbsysinit /etc/X11/Xsession.d | tail -1
/etc/X11/Xsession.d/90x11-common_ssh-agent
# ls -l /etc/X11/Xsession.d/90x11-common_ssh-agent
-rw-r--r-- 1 root root 629 2010-11-02 23:17 /etc/X11/Xsession.d/90x11-common_ssh-agent
# head /etc/X11/Xsession.d/90x11-common_ssh-agent
# $Id: 90x11-common_ssh-agent 305 2005-07-03 18:51:43Z dnusinow $
# This file is sourced by Xsession(5), not executed.
STARTSSH=
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS=
if has_option use-ssh-agent; then
if [ -x "$SSHAGENT" ] && [ -z "$SSH_AUTH_SOCK" ] \
#
Run Code Online (Sandbox Code Playgroud)