Skip to main content

So I already went through a couple of the similiar questions but I couldn´tcouldn't get anything to work. I

I am currently trying to use this:

sed -i '/^<script/,/script>/{/^<script/!{/script>/!d}}' file.txt

sed -i '/^<script/,/script>/{/^<script/!{/script>/!d}}' file.txt

Which I thought would delete everything between but<script and script> but as you might have guessed it doesn´tdoesn't do so.

this is the code that is in the txt file:

<script type="text/javascript">
 bla bla some script bla bla
</script>

There are multiple scripts at various places in the .txt.txt and it is supposed to delete every single one of them.

So I already went through a couple of the similiar questions but I couldn´t get anything to work. I am currently trying to use this:

sed -i '/^<script/,/script>/{/^<script/!{/script>/!d}}' file.txt

Which I thought would delete everything between but as you might have guessed it doesn´t do so.

this is the code that is in the txt file:

<script type="text/javascript">
 bla bla some script bla bla
</script>

There are multiple scripts at various places in the .txt and it is supposed to delete every single one of them

So I already went through a couple of the similiar questions but I couldn't get anything to work.

I am currently trying to use this:

sed -i '/^<script/,/script>/{/^<script/!{/script>/!d}}' file.txt

Which I thought would delete everything between <script and script> but as you might have guessed it doesn't do so.

this is the code that is in the txt file:

<script type="text/javascript">
 bla bla some script bla bla
</script>

There are multiple scripts at various places in the .txt and it is supposed to delete every single one of them.

edited tags
Link
terdon
  • 252.7k
  • 69
  • 481
  • 719
added an example
Source Link

So I already went through a couple of the similiar questions but I couldn´t get anything to work. I am currently trying to use this:

sed -i '/^<script/,/script>/{/^<script/!{/script>/!d}}' file.txt

Which I thought would delete everything between but as you might have guessed it doesn´t do so.

this is the code that is in the txt file:

<script type="text/javascript">
 bla bla some script bla bla
</script>

There are multiple scripts at various places in the .txt and it is supposed to delete every single one of them

So I already went through a couple of the similiar questions but I couldn´t get anything to work. I am currently trying to use this:

sed -i '/^<script/,/script>/{/^<script/!{/script>/!d}}' file.txt

Which I thought would delete everything between but as you might have guessed it doesn´t do so.

So I already went through a couple of the similiar questions but I couldn´t get anything to work. I am currently trying to use this:

sed -i '/^<script/,/script>/{/^<script/!{/script>/!d}}' file.txt

Which I thought would delete everything between but as you might have guessed it doesn´t do so.

this is the code that is in the txt file:

<script type="text/javascript">
 bla bla some script bla bla
</script>

There are multiple scripts at various places in the .txt and it is supposed to delete every single one of them

Source Link
Loading