Bash Script: Concatenate Lines & Insert Newlines After "because"
#!/bin/bash
Concatenate non-period-ending lines with following lines
sed -i -e ':a;N;$!ba;s/([^.])\n/\1 /g' text.txt
Start a new line after the word 'because'
sed -i 's/because/\nbecause/g' text.txt
Print the modified contents of text.txt
cat text.txt
原文地址: https://www.cveoy.top/t/topic/lW7k 著作权归作者所有。请勿转载和采集!