1

I have the following in my .screenrc file:

# Don't display the copyright page
startup_message off

# keep scrollback n line
defscrollback 5000

# setup some screens
screen -t top 0 top -o cpu -s 5
screen -t mysql 1 mysql -u root -p
screen -t shell_screen 2 cd ~/webroot
screen -t report_gen 3 tail -f ~/webroot/path/report_gen_log.txt

shelltitle "$ |bash"

#change the hardstatus settings to give an window list at the bottom of the
##screen, with the time and date and with the current window highlighted
hardstatus             alwayslastline
#hardstatus string '%{= mK}%-Lw%{= KW}%50>%n%f* %t%{= mK}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}'
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'

When I start up screen, only the first 2 screens are created.

What might be wrong?

I am runnong OSX, but I dont think that matters.

Zoredache
  • 130,897
  • 41
  • 276
  • 420
Darryl Hein
  • 1,712
  • 2
  • 19
  • 21

2 Answers2

8

Kyle is right -- that screen window 2 will fail because cd is a shell builtin. Even if it was a command, it would terminate immediately, and screen would close that window.

You can do something like this to get that to work:

screen -t shell_screen 2 bash -c "cd ~/webroot && bash"

The tail command (window 3) fails because of the "~" character. Screen does not do shell-style expansion, and so tail immediately fails (cannot open file) and terminates, and the screen windows is closed. Manually expand that ~ to the full path to your home directory, and that screen should work.

Ian Clelland
  • 782
  • 1
  • 5
  • 8
3

Not sure why the tail fails, but cd is a shell builtin, not a command, So you should get a no such command in window 2.

Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448