title: Spread 'sed' command over multiple lines
body: <p>I am trying to spread one sed command over several lines in a bash file. I have multiple patterns that sed checks for and I am hoping to separate some of the patterns by a line change. Here is my current script that does not work, putting everything on one line works but I was hoping to just clean it up a bit and split things up.</p>
  
  <pre><code>#!/bin/sh -f
  
  #files=$(ls -1 | egrep '.avi|.mkv');
  
  #echo $files
  for f in *.mkv *.avi;
   do
    renF=`echo $f | tr '.' ' ' | sed -e 's/ \([^ ]*\)$/.\1/; s/\ \[sharethefiles\ com\]//i' \
    -e 's/\ x264\-Ctu//i; s/\ x264\-Bia//i; s/\ x264\-Fov//i' \
    -e 's/\ Xvid\-Lol//i; s/\ Xvid\-Xor//i; s/\ Xvid\-Notv//i; s/\ Xvid\-Fqm//i; s/\ Xvid\-p0w4//i; Xvid\-BIA//i; s/\ Xvid\-Chgrp//i; s/\ Xvid\-Fov//i' \
    -e 's/\ PDTV\-Fov//i; s/\ PDTV\-River//i; s/\ PDTV\-Sfm' \
    -e 's/\ Dts\-Chd//i; s/\ WEB\-DL//i; s/\ H264\-SURFER//i' \
    -e 's/\ Dsr//; s/\ WS//i; s/\ PDTV//i; s/\ X264//i; s/\ Blu\-Ray//; s/\ Bdrip//i; s/\ Bluray//i; s/\ HDTV//i; s/\ DTS//i; s/\ AC3//i; s/\ Dd5//i; s/\ Dualaudio//i; s/\ AAC2//i; s/\ XVID//i'`
    #echo $renF
    if [ "$f" == "$renF" ]; then
          echo "FileName already cleaned."
    else
          mv "$f" "$renF"
    fi
   done
  </code></pre>
  
  <p>Thanks for any help!</p>