2

I have this in my ~/.screenrc file:

startup_message off

screen -t top 0 top
screen -t log 2 tail -f /path/to/application/log/*
screen -t action 1

#caption always "%?%F%{.R.}%?%3n %t%? [%h]%?"
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<" 

When I start screen, it opens all three windows, but as soon as I try to switch to window 2, it closes immediately. I would assume there is a problem with the shell and it exits instantly, but I can't find anything wrong with it. I have tried using quotation marks around the path and the entire command, which only leads to "file not found" errors. The command works just fine when I enter it directly into a shell.

The screen version is: Screen version 4.00.02 (FAU) 5-Dec-03

Help?

theintz
  • 121
  • 2

1 Answers1

2

I suspect that the problem is that the wildcard in /path/to/application/log/* isn't being expanded, since screen isn't a shell itself. Try executing the command within a shell:

screen -t log 2 sh -c "tail -F /path/to/application/log/*"
mgorven
  • 30,615
  • 7
  • 79
  • 122