Что касается Bash, .
и source
не являются псевдонимами для одного или другого, это простой факт, что они оба являются встроенными функциями, которые вызывают одну и ту же базовую функцию, source_builtin
.
Взгляните на файл source.def
из исходного кода Bash:
$PRODUCES source.c
$BUILTIN source
$FUNCTION source_builtin
$SHORT_DOC source filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
$BUILTIN.
$DOCNAME dot
$FUNCTION source_builtin
$SHORT_DOC. filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell. The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.
Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.
$END
Вы используете CMD
для настройки контейнера для запуска systemd, поэтому мне кажется, что это «полезно».
Чтобы запустить другую команду в вашем контейнере, либо:
docker exec
;