Есть ли способ узнать оценку использования версии ядра Linux в мире?

Solía ​​tener varios shells ejecutándose en screen. En mi.khsrc, personalizaría varias configuraciones, incluidas $PS1 y $HISTFILE (e incluiría el nombre base del dispositivo tty ).

Esto fue relativamente fácil de reconstruir:

tty=$(basename $(tty))
histdir=~/.hist
mkdir -p $histdir
export HISTFILE=$histdir/history.$tty
export PS1=$USER@'$PWD ['$tty'] ${?#0}$ '
exec /usr/bin/ksh

Guarde esto como ~/bin/screenshelly ejecute chmod +x ~/bin/screenshell. Ahora puede ejecutar screeny tener archivos de historial separados para cada ventana.

SHELL=~/bin/screenshell screen

Ejemplos:

Ventana 3

    vagrant@/home/vagrant [3] 127$ history
    1       history
    2       error
    3       history

Ventana 4

    vagrant@/home/vagrant [4] $ history
    1       history
    vagrant@/home/vagrant [4] $ echo $HISTFILE
    /home/vagrant/.hist/history.4
    vagrant@/home/vagrant [4] $ tty
    /dev/pts/4

Una alternativa sería ejecutar exec kshdesde .kshrc, pero necesitará algún tipo de prueba para evitar un bucle exec -.

3
17.10.2017, 14:08
0 ответов

Теги

Похожие вопросы