I'm setting up my screenrc to open several tabs and already insert commands such that I only need to press enter to start some process.

Here's an example screenrc:

screen -t test
stuff hello

However, if I start screen, the text "hello" will appear twice, because stuff is executed before the shell has loaded. This is what it looks like with my shell and the above screenrc:

screen session

How can I avoid the first "hello" shown in the terminal before the shell has loaded?

  • Is this an end in itself? If not, what larger goal are you trying to accomplish? – Fox Jul 19 '17 at 20:00
  • Yes, I simply don't like the clutter. – morxa Jul 20 '17 at 14:17
  • But are you trying to run a command (in which case you don't need stuff), to just print a thing (in which case .bashrc seems sufficient), or something else? – Fox Jul 20 '17 at 20:33
  • The goal is to have a screen session that fills a number of tabs with predefined commands so I only need to press enter to start. I don't want anything to start automatically, but I also don't want to type the commands manually. If there's an alternative to stuff, I'd be happy to use it – morxa Jul 20 '17 at 21:53
  • I'm not in a place where I can test this, but something like (as a line in the screen rc file) screen sh -c 'echo some-command; read && some-command; sh' should allow a pseudo pre-filling, cancellable by ctrl-c – Fox Jul 20 '17 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.