Agnus Dei (jackal) wrote,
Agnus Dei
jackal

Very cool - how to run a command ONLY from interactive shells.

This will only run when you ssh into the box with an interactive shell.
This will NOT run when you just ssh a command to the host. (( ssh host date ))

# Put this in your .bashrc
# man test and read -t :)
fd=0   # stdin
if [ -t "$fd" ]
then
   clear
   echo "This is an interactive shell"
fi
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 0 comments