How to concatenate stdin and a string?

前端 未结 9 1444
死守一世寂寞
死守一世寂寞 2021-01-30 01:49

How to I concatenate stdin to a string, like this?

echo \"input\" | COMMAND \"string\"

and get

inputstring
9条回答
  •  隐瞒了意图╮
    2021-01-30 02:25

    I'm often using pipes, so this tends to be an easy way to prefix and suffix stdin:

    echo -n "my standard in" | cat <(echo -n "prefix... ") - <(echo " ...suffix")
    prefix... my standard in ...suffix
    

提交回复
热议问题