Bash remove anything OUTSIDE quotation marks

  • A+

I have a curl request, which returns following output:

<a href="spike10-st-d43d7eff66aa.ovpn">pike10-st-d43d7eff66aa.ovpn</a>                 25-Sep-2018 13:49                4947 <a href="spike11-First-d43d7eff66aa.ovpn">spike11-First-d43d7eff66aa.ovpn</a>                 25-Sep-2018 14:04                4951 <a href="spike12-rst-d43d7eff66aa.ovpn">spike12-rst-d43d7eff66aa.ovpn</a>                 25-Sep-2018 14:27                4947 <a href="spike13-irst-d43d7eff66aa.ovpn">spike13-irst-d43d7eff66aa.ovpn</a>                 25-Sep-2018 15:00                4947 

Can anyone give me a hint, how to remove all outside quotation marks to receive only names of *.ovpn files, like this:

spike10-st-d43d7eff66aa.ovpn spike11-First-d43d7eff66aa.ovpn spike12-rst-d43d7eff66aa.ovpn spike13-irst-d43d7eff66aa.ovpn 


If the input won't contain any extra quotation marks, you can just use cut

cut -d/" -f2 filename 

This will delimit on quotation marks, and get the 2nd field. Simple.


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: