3 ms·
I use .profile for exporting environment variables and .rc for everything else. The rationale is that exported env variables are inherited (and I most probably
by praptak 6y ago
I use .profile for exporting environment variables and .rc for everything else.
The rationale is that exported env variables are inherited (and I most probably don't want them overwritten by child interactive shells reading .*rc) and other things (e.g. aliases) aren't and I probably want them set for every interactive shell.
- JoshTriplett 6y agoThat's the theory, but desktop environments often won't run your `.bash_profile` or `.profile` (so you won't end up with environment variables set in graphical apps), and then most terminal emulators don't run login shells by default (so you won't end up with environment variables set in your shells either). And even if your terminal emulator runs a login shell, you'll only have environment variable set in your shells, which will lead to problems when graphical apps don't have the same variables set.