如何简洁地执行Linux嵌套命令行?

Jas*_*son 2 linux command-line

这里嵌套的命令行意味着一个命令的输出是另一个命令的输入.例如下面:

$ CmdA

output1 output2 output3...
Run Code Online (Sandbox Code Playgroud)

现在我想运行CmdB,它使用CmdA的输出作为参数.那么如何简洁地运行CmdB而不是使用

$ CmdB output1 output2 output3...

我现在有一个实际问题:

$ python-config --cflags --ldflags

-I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv
-lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic
Run Code Online (Sandbox Code Playgroud)

如您所见,命令python-config生成了许多项目.如果我编译.cpp源文件,我必须写所有项目,如

gcc test.cpp -I/usr/include/python2.7 -fno-strict-aliasing -02 -g -pipe........-o test,所以我只是想找到一种执行调用者命令的简单方法.

谢谢你的提示!

N 1*_*1.1 5

gcc test.cpp `python-config --cflags --ldflags`
Run Code Online (Sandbox Code Playgroud)

更多:命令替换