The recommended solution is to not use an alias to define functionality which isn't exclusively for interactive use (and even then, shell functions are superior in a number of ways).
Refactor the alias into a standalone script and call it like any other external command.
In more detail, if you have
alias myalias='for x in foo bar baz; do
frobnicate "$x"; done'
you can improve it so it doesn't pollute your global namespace by turning it into a function
myalias () {
local x
for x in foo bar baz; do
frobnicate "$x"
done
}
or just save it as /usr/local/bin/myalias and chmod a+x /usr/local/bin/myalias to make it executable for everyone;
#!/bin/sh
for x in foo bar baz; do
frobnicate "$x"
done
(This runs in a subprocess so x will be gone when the script finishes; so we don't need to make it local.)
(Of course, if frobnicate is at all competently written, maybe you can simplify to just frobnicate foo bar baz as well.)
This is a common FAQ.
call, rather than rely on an alias that may or may not be present.call()args, or convert the alias into a script thatcall()can invoke.