我有这个在我的〜/ .screenrc文件中:
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%<"
当我开始屏幕时,它会打开所有三个窗口,但只要我尝试切换到窗口2,它立即closures。 我会假设shell有问题,它会立即退出,但我找不到任何错误。 我曾尝试在path和整个命令周围使用引号,这只会导致“文件未find”错误。 当我直接将它input到一个shell中时,该命令工作得很好。
屏幕版本是: Screen version 4.00.02 (FAU) 5-Dec-03
帮帮我?
我怀疑问题是/path/to/application/log/*中的通配符没有被扩展,因为屏幕本身不是一个shell。 尝试在shell中执行命令:
screen -t log 2 sh -c "tail -F /path/to/application/log/*"