九零不老心
发布于 2021-07-12 / 9 阅读 / 0 评论 / 0 点赞

shell换行拼接

shell将多行内容的换行符替换为指定字符,然后进行拼接

grep ^pt_key ../env/all_cookies.txt | paste -s -d '&'

也可以使用tr进行替换,但是拼接末尾会多出指定字符,需要额外处理