Files
config-bash/rc.d/screen
T
xavier 55d2607035 style: Use command -v instead of which for availability checks
rc.d/anyenv, rc.d/screen, aliases.d/mc, and rc.d/startx were the last
holdouts still using `which` to check tool availability. Every other
file in rc.d/* already uses `command -v`, which doesn't depend on an
external binary being installed.
2026-08-22 00:55:55 +02:00

25 lines
711 B
Plaintext

# GNU Screen stuff
if ( command -v screen &> /dev/null )
then
if [[ ${TERM} != screen* ]]
then
if [ "$(screen -ls | sed -ne 's/[[:space:]]//' -ne 's/(Attached)// p')" ]
then
echo ''
echo_reverse 'Il existe des sessions screen attachées sur cette machine pour cet utilisateur !'
echo ''
screen -ls | grep "Attached" | sed -e 's/^/ /'
echo ''
fi
if [ "$(screen -ls | sed -ne 's/[[:space:]]//' -ne 's/(Detached)// p')" ]
then
echo ''
echo_reverse "Il existe des sessions screen détachées sur cette machine pour cet utilisateur !"
echo ''
screen -ls | grep "Detached" | sed -e 's/^/ /'
echo ''
fi
fi
fi