Reputation: 345
$ lynx --dump -listonly index.html
Example result:
References
Visible links
1. http://lynx.invisible-island.net/
2. http://lynx.invisible-island.net/lynx.html
3. http://lynx.invisible-island.net/current/index.html
What I want to do is remove the 1. 2. and 3. "References" and "Visible Links" text included.
Wanted Result:
http://lynx.invisible-island.net/
http://lynx.invisible-island.net/lynx.html
http://lynx.invisible-island.net/current/index.html
Upvotes: 5
Views: 2800
Reputation: 170
You can use -nonumbers option of Lynx
lynx --dump -nonumbers -listonly http://lynx.invisible-island.net/
Upvotes: 16
Reputation: 583
I have this input, with spaces on top of each line:
1. http://lynx.invisible-island.net/
2. http://lynx.invisible-island.net/lynx.html
then, with the suppression of lines 1 to 3:
lynx --dump -listonly http://lynx.invisible-island.net/ | sed -E 's/^ ?+[0-9]+\. //; 1,3d'
output
http://lynx.invisible-island.net/
http://lynx.invisible-island.net/lynx.html
Upvotes: 0
Reputation: 5449
Try:
lynx --dump -listonly index.html | sed -r 's/^[0-9]+\. //'
Upvotes: 0