Is there a way to write a script which can go over all the interactive bash shell processes running on the same computer one by one, and run some command in each interactive bash shell respectively?
Assume only bash, no zsh etc. but if there are other kinds of shells such as zsh, then all the shells.
"interactive" because the command I am going to run is to collect some information about interactive usage of a shell, for example running
jobsand collecting their outputs from all the shells into a single list or file.
Two interactive shell processes are deemed different, if
jobsgives different outputs in them.