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
  • 152,036
  • 28
  • 249
  • 266
Andreas Rainer
  • 314
  • 4
  • 16

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
  • 12,320
  • 2
  • 11
  • 18