Last active
June 19, 2024 08:04
-
-
Save ChieftainY2k/e43cc74fef2b17bd2b251d43099c3135 to your computer and use it in GitHub Desktop.
My private screen session for shared shell environments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
NAMESPACE=${NAMESPACE:-default} | |
echo "************************************************************************************************************" | |
echo "This screen session is for namespace \"${NAMESPACE}\" " | |
echo "If you are not the owner of this namespace please exit now (Ctrl-C) , thanks :)" | |
echo "If you want to use your own screen namespace, use: NAMESPACE=youname $0" | |
echo "Press ENTER to continue or Ctrl-C to exit" | |
echo "************************************************************************************************************" | |
read | |
export HISTFILE=/home/$USER/.bash_history_${NAMESPACE} | |
touch "${HISTFILE}" | |
screen -dr "${NAMESPACE}" || screen -S ${NAMESPACE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment