title: How to cmp multiple files with relative paths using bash
body: <p>I have a directory called filesystem that looks a little like this:</p>
  
  <pre><code>- filesystem
    - etc
      - systemd
        - system
          - custom.service
          - custom2.service
    - hostname
  </code></pre>
  
  <p>These files are copied into the root directory then need to be verified. For example: <code>filesystem/etc/hostname</code> is copied into <code>/etc/hostname</code>.</p>
  
  <p>I've tried this to write a bash script to compare every file in filesystem.</p>
  
  <pre><code>for file in $(find filesystem -type f)
  do
    cmp file ${file#filesystem}
  done
  </code></pre>
  
  <p>The purpose of <code>${file#filesystem}</code> is to remove the 'filesystem' from the path of the second file.</p>
  
  <p>This isn't working - it returns 'No such file or directory'. How to fix this code?</p>