screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Putting 'banner' into each started screen.........


From: David T. Pierson
Subject: Re: Putting 'banner' into each started screen.........
Date: Sun, 18 May 2014 10:08:29 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, May 17, 2014 at 10:12:02PM -0400, Mike Gerwitz wrote:
> On Sat, May 17, 2014 at 08:47:12AM +0100, Another Sillyname wrote:
> > which does work and shows the banner but also throws up a message...
> > 
> > Attaching from inside of screen?
> > 
> > I call a script from inside of /etc/profile that checks to see if
> > screen is started and if it isn't starts it before allowing the ssh
> > connection, my guess is that this is creating a one time loop?
> 
> You can use `bash --noprofile`, but note that the profile config may also
> source ~/.bashrc; you can provide --rcfile to specify what configuration
> file to source; see bash(1) for more details.
> 
> Of course, if the banner is output by /etc/profile or something that
> --noprofile suppresses, you may be better off just foregoing --login and
> using --rcfile, or even -c.

I second these suggestions.  In fact you might want to simply start the
shell with a certain environment variable set which will trigger the
banner.

  screen -t mytitle env PRINT_BANNER=1 bash

In .bashrc:

  if [ -n "$PRINT_BANNER" ]; then
    banner ...
    unset PRINT_BANNER
  fi

You could even use the existing $STY and $WINDOW variables that screen
itself sets (though subshells would print the banner too).

David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]