. ~/.bashrc is what I'm use to source the bash script in bash shell. But I have quite a few scripts that I want to run from tcsh.But this command doesn't work for tcsh. Why doesn't this work? Is there a different file similar to bash profile when I work on t shell?
Any links to look up?
Thx!
The tcsh
equivalent to the bash
and posix shell .
is source
.
That said, bash
and tcsh
are entirely different shells. You will not be able to source ~/.bashrc
from tcsh, if that was your intent.
You can run a shell script of any type as long as that shell script has the appropriate shebang
in its first line, but it'll run in its own process, and not in the context of your interactive tcsh instance.
If, for example, you have a directory: ~/.tcshrc.d
, and you want to include all the files in that directory in your login shell, you might include the following in your .tcshrc
file:
foreach i ( ~/.tcshrc.d/* )
source $i
end
Note that this is tcsh
code, and is not compatible with bash
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.