4

I often start a screen session, issue a ":multiuser on" command and then ":acladd someuser".

Is there some way to get with a single shell command a screen session to start with these two commands automatically?

Thanks!

GJ.
  • 529
  • 1
  • 7
  • 21

2 Answers2

7

Use a custom screen config file with screen -c file. For example:

echo "multiuser on" >> multiscreen.conf
echo "acladd someuser" >> multiscreen.conf
alias multiscreen='screen -c multiscreen.conf' # bash syntax for alias
multiscreen
Andrew
  • 8,002
  • 3
  • 36
  • 44
0

Add them to your ~/.screenrc file (without the colons). See the screen man page and the example files it refers to (possibly at /usr/share/doc/screen/examples).

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
  • hmm.. I need it as an optional thing, not for all screen sessions. using the .screenrc would probably apply all the time, wouldn't it? – GJ. Jun 27 '10 at 22:14