Aliases are shell-specific - in this case, most likely, bash-specific. To execute an alias, you need to run bash, but aliases are loaded only for interactive shells (more precisely, .bashrc will only be read for an interactive shell).
bash -i launches an interactive shell (and .bashrc sources). bash -c cmd starts cmd.
Combine them: bash -ic cmd runs cmd in an interactive shell, where cmd can be the bash function / alias defined in your .bashrc .
find -name \*bar\* | xargs bash -ic gi foo
should do what you want.
Edit: I see that you marked the question as "tcsh", so the bash special solution is not applicable. With tcsh, you don't need -i since it seems to read .tcshrc unless you give -f .
Try the following:
find -name \*bar\* | xargs tcsh -c gi foo
It worked for my core testing.
camh Jun 11 '09 at 6:38 2009-06-11 06:38
source share