3

I know there is post in here already explaining how to do it, but I'm doing exactly what its says, but cant get my bash function to work with xargs. My bash profile looks like this:

export -f eb_deploy

function eb_deploy()
{
  echo Deploying $1
  eb deploy $1
}

function deploy_app()
{
aws elasticbeanstalk describe-environments --application-name $1 | grep EnvironmentName | cut -d: -f 2 | sed 's/\"//g' | sed 's/\,//g' | xargs -n1 eb_deploy
}

But I always get

xargs: eb_deploy: No such file or directory

Could anyone enlighten me why is this not working?

Im currently running Mac OS X Yosemite Version: 10.10.3

Thiago Loddi
  • 2,212
  • 4
  • 21
  • 35
  • 2
    `xargs` uses `execve()` to invoke things called. Exec calls do not start shells, unless a shell or a program whose shebang specifies a shell is given as an argument. Without a shell, no exported function is ever imported. – Charles Duffy Jul 31 '15 at 00:07

0 Answers0