2 つのシンボル間の文字列を一致させて置換する

2 つのシンボル間の文字列を一致させて置換する

次のようなリンクが多いファイルがあります。

http://example.com/mall/mall/detail3.jsp?proID=2114280
http://example.com/mall/member/member/bookshelves/add.jsp?proID=3354136&productName=something
http://example.com/mall/bestbookTW//mall/detail3.jsp?proID=3435839&c=532166&id=954325

私はそれが次のように見えるようにしたいです:

http://example.com/mall/mall/detail3.jsp?proID=FUZZ
http://example.com/mall/member/member/bookshelves/add.jsp?proID=FUZZ&productName=FUZZ
http://example.com/mall/bestbookTW//mall/detail3.jsp?proID=FUZZ&c=FUZZ&id=FUZZ

sed、grep、またはawkを使用してこれをどのように実行できますか?

ベストアンサー1

また試み

awk 'gsub("=[^&]*", "=FUZZ")' file 
http://example.com/mall/mall/detail3.jsp?proID=FUZZ
http://example.com/mall/member/member/bookshelves/add.jsp?proID=FUZZ&productName=FUZZ
http://example.com/mall/bestbookTW//mall/detail3.jsp?proID=FUZZ&c=FUZZ&id=FUZZ

おすすめ記事