0

i've got an HTML-File like this:

<script src="jljlaösf" type="module"></script><script nomodule defer></script><script src="soll bleiben" defer ></script><script src="asdflöksfndakhfsakö" type="module"></script>

Now, I have to delete all tags with type="module" in it using RegEx- or best SED in a UNIX Shell - no matter what is written in the src="xxxxx" attribute (the only thing that can differ)

Can someone please help me out on this one?

Greets Andi

hek2mgl
  • 143,113
  • 25
  • 227
  • 253
Andreas Rainer
  • 304
  • 3
  • 12

1 Answers1

0
grep -Ei '<.*type="module"><\/script>' htmlfile

Enable regular extension with grep through -E and then do an inverse selection with -i/ Search for <...type="module"> and print everything else.

Raman Sailopal
  • 11,713
  • 2
  • 8
  • 16