PDA

View Full Version : [ubuntu] how .bashrc executes?



Macinbomzh
February 5th, 2010, 01:52 PM
I have to know how .bashrc executes, does ubuntu wait for the script to complete and then
continues the loading, or is it allowing .bashrc to run parallel to the loading?
Is there a way to run a command as root when logging into a user?

cong06
February 5th, 2010, 02:49 PM
Maybe you mis understand the "~/.bashrc" file?

This file (as most that end with 'rc') is a configuration files, and helps to configure the bash prompt.
Some of the lines of code here set up variables, some set up aliases, some set up coloring.

If you make a change to the '.bashrc' file, you want to re-load it. This happens automatically when you open a terminal, but to save you the 'opening and closing' just type:


. .bashrc


Maybe this will help: http://tldp.org/LDP/abs/html/sample-bashrc.html

Macinbomzh
February 5th, 2010, 06:45 PM
ok, so is there a way to execute a command as a superuser after login?
basically my problem is that powernowd, a cpu freq control daemon, is switching the governor to performance after 7 seconds of login
because ondemand is not working; so I wrote a program that waits for the switch to performance and
after that it switches it back to userspace but I need to execute it at login

cong06
February 6th, 2010, 10:17 AM
It sounds like you want to execute it in the 'rc.local' file?

Either that or:
System > Preferences > Startup

Probably what you were confusing it with is the ".bash_profile" but I'm pretty sure that doesn't run until you open up a terminal.

http://hacktux.com/bash/bashrc/bash_profile