更新时间:2023-02-23 14:09:22
我将使用Perl,因为我知道的语法,而无需看它,但它会在AWK非常相似或sed的,因为tekknolagi说:
I'll use Perl, because I know the syntax without having to look it up, but it would be very similar in awk or sed, as tekknolagi says:
perl -pi -e 's|http://site.com/.*([^/]+)"/>|web/$1"/>|;' <filename>
这将美元最后夹住的p $ pserve一切/和
This will preserve everything between the last / and the "