Among the 8 virtual desktops I'm using, I have 18 terminals open right now.
I change some of my user configuration (e.g. put a new alias into ~/.bashrc); but in order to use this new added alias, I have to source the config file:
That's all good, but the sourcing stays local to the current terminal. Is there a way to source my .bashrc on ALL open terminals, so that I can use it from any one of them?
I know I can echo into any terminal
But is there a way to run a command like this?
Something like
I'm running bash on CentOS box.
Thank you!
It seems that every shell you run is a login shell. Bash reads and executes the ~/.bashrc file only if it is started as an interactive, but not login shell. When Bash starts as an interactive login shell, it reads and executes the ~/.bash_profile file. What you could do is to source the ~/.bashrc file from the ~/.bash_profile file. Something like this:
# .bash_profile
# sourcing .bashrc:
. ~/.bashrc
this way every interactive shell you start will read and execute the ~/.bashrc file, be it a loging shell or not.
Thanks for the response.
But that is not my problem. I'd like to source the config file (.bashrc, .bash_profile, .myConfigFile, etc.) across all terminals that are already running. So that I don't have to close them, and restart (and lose history, kill programs tied to them etc.)
To my knowledge you'll have to manually source the rc file in each running instance of the shell.
If you want to be clever, and anticipate doing this often enough, you could put the following command into your .bashrc file:
Once that is set in a running instance of bash, you then only need to send a SIGUSR1 (16) to the process and it will resource the .bashrc file. You could write a small script that susses out all of your running login/interactive shells and executes the necessary kill -16 command. You could pick another signal, but this seems just fine for this case.
Hope this helps some.
Last edited by agama; 05-09-2011 at 11:46 PM..
Reason: typo
Hi All ,
i am trying to create an alias to open a new gnome-terminal and run some commands in each tab & to have a specific name for each tab
i am using csh ,
tried this command
gnome-terminal --tab -t "s1" --tab -t "s2" --tab -t "s3" --tab -t "s4"
it opened 4 tabs but the title didn't... (0 Replies)
hi,
how to write shell script that runs different commands(like:ls,ps,ls-l) in differnt terminals(each command should run in different terminal).
my main motive is to run different 'c' program exe's available in different locations in different terminals.
thanks
sai (2 Replies)
OK this is a bit messy.
I run Fedora with gnome on a compiz desktop, I have a script (userstart) that opens my 'standard' environment for all my machines when I login. userstart flips to a specific workspace and then opens the required applications in that workspace then flips to the next... (2 Replies)
I have written a simple script to show battery life remaining. I would like to be able to quickly view it with a predefined keybinding or launcher.
xterm -e scriptname should do the trick but the xterm closes when the script finishes, not giving me chance to read the output. How can I keep... (3 Replies)
I just wondering if there are ways to open multiple virtual terminal to a single LPAR.
After I have use putty to login to the VIOS. I will use mkvt -id <LPAR id> to open console but if my friend want to open 2 second one, it will say, VT already connected.
IS there a way to work this around ? ... (1 Reply)
Hi, I am working in huge environment, I do type commands from my terminal window repeadly in all same setup unix environments. I am looking some kind of a terminal emulator or some simple program that will help me?
basically if type command like 'ls' in one unix terminal window it should echo... (5 Replies)