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

"David T. Pierson" <dtp-tWP3OOf8k3DqlBn2x/[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <1400421456.17557%[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.