Ни bash, ни zsh не имеют этой функции.
Вы можете вызвать newgrp
. Это внешняя команда, запускающая новый процесс. Он запускает программу, указанную переменной среды SHELL
, без аргументов.
newgrp common <
Обратите внимание, что поскольку newgrp
запускает новую оболочку, она не наследуется от переменных оболочки исходной оболочки, а только от (экспортируемых) переменных среды. Выполненные здесь задания вступят в силу только там.
Respuesta tardía. Recientemente me encontré con este problema y encontré una posible respuesta.
Suponga que desea instalar el archivo de encabezado del kernel en /usr/src/linux-headers-4.15.3
. El árbol de fuentes del núcleo compilado se encuentra/path/to/compiled/linux-4.15.3/
primero, descomprima un árbol de fuentes del núcleo limpio
tar xvf linux-4.15.3.tar.xz
cd linux-4.15.3/
segundo, copie su archivo .config
al directorio
cp /path/to/compiled/linux-4.15.3/.config.
tercero, ejecútelo y luego elimine el archivo.config en el directorio de origen para obtener una fuente de kernel limpia
make O=/usr/src/linux-headers-4.15.3 oldconfig
rm.config
cuarto, ejecute el modules_prepare
make target
make O=/usr/src/linux-headers-4.15.3 modules_prepare
Finalmente, elimine las cosas inútiles y copie las cosas necesarias
rm /usr/src/linux-headers-4.15.3/source
cp /path/to/compiled/linux-4.15.3/Module.symvers /usr/src/linux-headers-4.15.3
Ahora, el directorio /usr/src/linux-headers-4.15.3
puede construir el módulo.
Documentaciónhttps://www.kernel.org/doc/Documentation/kbuild/modules.txtcuéntanosmodules_prepare
This will make sure the kernel contains the information required. The target exists solely as a simple way to prepare a kernel source tree for building external modules.
NOTE: "modules_prepare" will not build Module.symvers even if CONFIG_MODVERSIONS is set; therefore, a full kernel build needs to be executed to make module versioning work.