On Sat, Sep 11, 2010 at 12:37 PM, Thomas Habets <tho...@habets.pp.se> wrote: > > Is it possible to turn on a mode where what I type is written to all open > windows at the same time? > > If not, I'd like to request that feature. > > I'd like to use it to send identical commands to a bunch of routers that > I've logged into.
Here's a little bash script I call sendcmd to do what you want: #!/bin/bash # usage: sendcmd -c "echo hello world" -w 0,1,3 WINDOWS=0 CMD="" while getopts 'c:w:' OPT; do case $OPT in c) CMD=$OPTARG;; w) WINDOWS=$(echo $OPTARG | sed 's/,/ /g');; esac done # Use the first screen found STY=$(screen -list | grep pts | head -1 | sed -e 's/^\s//' -e 's/\s.*$//') for WIN in $WINDOWS; do STY=$STY screen -X at $WIN stuff "$CMD\n" done > > --------- > typedef struct me_s { > char name[] = { "Thomas Habets" }; > char email[] = { "tho...@habets.pp.se" }; > char kernel[] = { "Linux" }; > char *pgpKey[] = { "http://www.habets.pp.se/pubkey.txt" }; > char pgp[] = { "A8A3 D1DD 4AE0 8467 7FDE 0945 286A E90A AD48 E854" }; > char coolcmd[] = { "echo '. ./_&. ./_'>_;. ./_" }; > } me_t; > > _______________________________________________ > screen-users mailing list > screen-users@gnu.org > http://lists.gnu.org/mailman/listinfo/screen-users > _______________________________________________ screen-users mailing list screen-users@gnu.org http://lists.gnu.org/mailman/listinfo/screen-users