In my shell environment I have aliases and custom functions. When I am in an instance of emacs (I always use emacs -nw) and I execute a shell command (M-!
emacs -nw
M-!
Put the aliases and functions in .bashrc, not .bash_profile. The latter is only executed in login shells, the former is in all shells.
.bashrc
.bash_profile