开发者

Pipe to command that does not accept piping

开发者 https://www.devze.com 2023-03-30 17:45 出处:网络
I want to use MPC (CLI interface to MPD) but unfortunately to me it does not accept piping. So something like:

I want to use MPC (CLI interface to MPD) but unfortunately to me it does not accept piping.

So something like:

ll | grep "pattern" | sed 's/this/that/' | mpc

does not work for me, nor

ll | grep "pattern" | sed 's/this/that/' | mpc -

This

MPCTMP=`ll | grep "pattern" | sed 's/this/that/'` && echo $MPCTMP

works as expected, but this:

MPCTMP=`ll | grep "pattern" | sed 's/this/that/'` && mpc $MPCTMP

does not return results, var开发者_JAVA技巧iable is not understood but this program

I'm new to Linux and could not find anything searching with Google

Thanks


Try xargs

ll | grep "pattern" | sed 's/this/that/' | xargs mpc
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号