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.
我有一条线:
something ..fdfad ABCD info fdsafsda fae faefdsa fABCD info23
我想在 ABCD 之后排队
让你的 shell 处理它:
line="something ..fdfad ABCD info" printf "result:%s\n" "${line##*ABCD }"
$ sed 's/.*ABCD //' file info info23
您可以为此使用 awk
awk '{printf "%s\n", $NF}' FS="ABCD" myfile