Or are they both not allowed at the same time?

2 Answers 2


Why wouldn't they be?

They're only executed by their respective shells though...

csh and bash are different programs that happen to do similar functions.


Not only is it possible, some systems set up new accounts with both. This allows the same skeleton setup to be used whichever shell the user gets.

The purpose of the two file is the same, but they belong to two different shell families. The syntax of the shell scripts for the two shells is very different so different scripts are required.

With a bit of care it is possible to use the same rc file for Bourne shell, ksh, and bash. This can be done by inclusion or hard links.

  • It can also be done by testing in the rc file for the current shell. Jan 21, 2012 at 0:26
  • @KeithThompson: Use of inclusion and hard links can be used when the rc names are different: .shrc. .kshrd, .bashrc, etc. Testing the for the shell type might be required in some edge case.
    – BillThor
    Jan 21, 2012 at 3:22
  • bash, ksh, and zsh will all source $HOME/.profile, at least if their shell-specific startup files aren't available. Having a single .profile with shell-specific sections (checking whether $BASH_VERSION is set, and so on) might be a reasonable approach if you commonly use two or more Bourne-derived shells. (I haven't tried that myself.) Jan 21, 2012 at 6:13
  • @KeithThompson: The bourne shell variants tend to share profiles but this is not always the case. The rc files usually have different defaults, although there can be configuration options to address this. Newer shell builds and newer platforms tend to be more likely to have this capability.
    – BillThor
    Jan 21, 2012 at 23:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .