我有一些bash函数输出一些信息:
> find-modelname-in-epson-ppds
> find-modelname-in-samsung-ppds
> find-modelname-in-hp-ppds
>等…
function filter-epson { find-modelname-in-epson-ppds | sed <bla-blah-blah> } function filter-hp { find-modelname-in-hp-ppds | sed <the same bla-blah-blah> } etc ...
但是我以为这样做会更好:
function filter-general { (somehow get input) | sed <bla-blah-blah> }
function high-level-func { # outputs filtered information find-modelname-in-hp/epson/...-ppds | filter-general }
如何用最好的bash做法实现这一点?