Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a customer .screenrc for Screen and I can't seem to find a way for it to support variables. Here's what I'm trying to accomplish:

I want to press ^l, then specify a name, and that will be the logfile name. My idea for how the .screenrc file should look was this:

    bindkey "^l" logfile $1

Any ideas on how to properly accomplish this? Thanks!

share|improve this question

You can use environment variables.

From man screen:

Commands may contain references to environment variables. The syntax is the shell-like "$VAR " or "${VAR}".

share|improve this answer

Try below setting.

bindkey "^l" colon 'logfile '

You press C-a C-l, then screen input prompt is:

:logfile |
         ^-cursor position

And you continue to input logfile name.

e.g. If you would like to start logging with filename 'hoge.log' then, type this.

C-a C-l hoge.log<ENTER>

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.