Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have to worry about the slashes in the text you are replacing.</p> <ul> <li>Either: use '<code>\/</code>' for each slash,</li> <li>Or: cheat and use '<code>.</code>' to match any character at the point where the slash should appear.</li> </ul> <p>The alternative exploits the improbability of a file containing the HTML. Theoretically, if you don't like the second alternative, you should also use '<code>\.</code>' at each point where '<code>.</code>' appears in the string you're looking at.</p> <pre><code>sed -e 's/&lt;SCRIPT LANGUAGE="JavaScript" TYPE="text.javascript" SRC=".height.js"&gt;&lt;.SCRIPT&gt;/ /' file_names </code></pre> <p>This is copied from your example and slashes are replaced by dots. However, supplying all the file names on the command line like that will simply write the output as the concatenation of all the edited files to standard output.</p> <p>Classically, to edit files more or less in situ, you'd write:</p> <pre><code>tmp=${TMPDIR:-/tmp}/xxx.$$ trap 'rm -f $tmp; exit 1' 0 1 2 3 13 15 for file in ...list... do sed -e '...' $file &gt; $tmp mv $tmp $file done rm -f $tmp trap 0 </code></pre> <p>This includes reasonably bullet-proof clean-up of the temporary - it is not perfect. This variant backs up the original before replacing it with the edited version:</p> <pre><code>tmp=${TMPDIR:-/tmp}/xxx.$$ trap 'rm -f $tmp; exit 1' 0 1 2 3 13 15 for file in ...list... do sed -e '...' $file &gt; $tmp mv $file $file.bak mv $tmp $file done rm -f $tmp trap 0 </code></pre> <p>With GNU <code>sed</code>, you can use the '<code>-i</code>' or '<code>--in-place</code>' option to overwrite the files; you can use '<code>--in-place=.bak</code>' to create backup copies of each <code>file</code> in <code>file.bak</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload