Alias – from

Aliases are not expanded when the shell is not interactive, unless the expand_aliases shell option is set using shopt (see the description of shopt under SHELL BUILTIN COMMANDS below).

So put a

shopt -s expand_aliases

in your script.

Make sure to source your aliases file after setting this in your script.

shopt -s expand_aliases source ~/.bash_aliases

XARGS – from

$ ls | xargs -Ifile mv file file.txt $ ls a.txt  b.txt  c.txt  x.txt  y.txt  z.txt