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

_______________________________________________
screen-users mailing list
screen-users@gnu.org
https://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to