How to concatenate stdin and a string?

前端 未结 9 1455
死守一世寂寞
死守一世寂寞 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

    You can do it with sed:

    seq 5 | sed '$a\6'
    seq 5 | sed '$ s/.*/\0 6/'
    

    In your example:

    echo input | sed 's/.*/\0string/'
    

提交回复
热议问题