2
grep เพื่อละเว้นรูปแบบ
ฉันกำลังดึง URL จากเว็บไซต์โดยใช้ cURL ดังต่อไปนี้ curl www.somesite.com | grep "<a href=.*title=" > new.txt ไฟล์ new.txt ของฉันมีดังต่อไปนี้ <a href="http://website1.com" title="something"> <a href="http://website1.com" information="something" title="something"> <a href="http://website2.com" title="some_other_thing"> <a href="http://website2.com" information="something" title="something"> <a href="http://websitenotneeded.com" title="something NOTNEEDED"> อย่างไรก็ตามฉันต้องดึงข้อมูลด้านล่างเท่านั้น <a href="http://website1.com" title="something"> <a href="http://website2.com" information="something" title="something"> ฉันพยายามที่จะไม่สนใจ<a hrefที่มีข้อมูลในพวกเขาและท้ายที่สุดกับชื่อNOTNEEDED ฉันจะแก้ไขคำสั่ง grep ได้อย่างไร
12
grep