Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
cat 命令到我自己的文件中的结果 ABC:=ABCD BCD:=BCDE CDE:=CDEF
ABC:=ABCD BCD:=BCDE CDE:=CDEF
我要做的就是将其打印为: ABCD BCDE CDEF
ABCD BCDE CDEF
问题是在前面的字符之前的每个“:=”之后打印字符。
如何使用 sed 来实现?
你可以试试:
your_command | sed 's/.*:=//'
两种非sed方式:
... | awk -F ':=' '{print $NF}' ... | while IFS= read -r line; do echo "${line##*:=}"; done