0

I typically use about 10 windows in GNU screen and am constantly customizing my .bashrc. I would like to be able to source .bashrc across screen windows with a one-liner. Can I broadcast a command to all my screen windows without detaching my session, running the command (in this case, sourcing the profile) and re-attaching to the screen session? I use Mac OS 10.8.

I believe this solution will also work for what I want to do, but I'm curious as to whether there is a more concise way.

1 Answer 1

2

From the Screen User Manual, you can send arbitrary text to all screen windows via it's -X command line argument combined with the builtin screen commands at and stuff with the following command, in your case

screen -X at \# stuff "source ~/.bashrc\n"

Keep in mind that this command is the equivalent to typing "source ~/.bashrc" in to every window. If a window isn't at a bash prompt and is instead say, editing a file with vim, it will have some unexpected results.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .