I have a cshrc file with aliases, in that file I want to set up an alias that point to a function defined in a bash file.
bash function file AliasFunc:
bash -c 'source AliasFunc'
alias bashfunc aaa
bashfunc #calling bashfunc
bashfunc: Command not found.
bash -c 'source AliasFunc' in your cshrc file does is start a new bash shell, load the
AliasFunc file, and exit. It will not affect the parent csh shell at all.
It just so happens that bash and csh both have a
source keyword, but that doesn't mean it's somehow "compatible". What you're trying to do now is equivalent of trying to import a Python module in Perl by starting a new Python process from within a Perl program.
What you can do is something along the lines of:
$ alias bashfunc 'bash -c "source AliasFunc && aaa"' $ bashfunc stackoverflow
Every time the
bashfunc alias is invoked it will start a new bash shell which will source the
AliasFunc file and will immediately run the bash