Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pipe to export command

Why does export fail when used as the last step in a command pipeline?

echo FOO=bar | xargs export
# => xargs: export: No such file or directory

I can rewrite it this way to accomplish what I want:

export `echo FOO=bar`

But why can't I use export in the first way?

like image 242
pje Avatar asked Dec 14 '12 23:12

pje


1 Answers

export is a shell builtin and xargs expects an actual binary.

like image 75
hd1 Avatar answered Oct 10 '22 19:10

hd1