title: Files are slipping through my check
body: <p>I have a bash script which recursively prints the sizes of files</p>
  
  <pre><code>for x in `ls $1`; do
      if [[ -d $x ]]; then
          echo "Going into $x"
          bash `readlink -en $0` `readlink -en $x`
          echo "Returning to parent"
      elif [[ -f $x ]]; then
          wc -c $x
      elif [[ -h $x ]]; then
          echo "Symbolic"
      elif [[ -b $x ]]; then
          echo "block-special"
      elif [[ -c $x ]]; then
          echo "character-special"
      elif [[ -p $x ]]; then
          echo "pipe"
      elif [[ -S $x ]]; then
          echo "socket"
      else
          echo Skipping $x
      fi
  done
  </code></pre>
  
  <p>But some files are falling through to the else statement. For example, </p>
  
  <pre><code>$ stat Desktop.tar.gz
    File: 'Desktop.tar.gz'
    Size: 1884        Blocks: 8        IO Block 4096    regular file
  ...
  </code></pre>
  
  <p>So even though Desktop.tar.gz is labeled as a regular file, it's not caught by <code>if [[ -f $x ]];</code>... Why might that be? It's not just a couple files either, it's <em>most</em> of them.</p>
  
  <pre><code>$ ls
  backup                       csc         Desktop    etc         forkres
  IdeaProjects  log       ppid    s3       Templates   Videos
  </code></pre>
  
  <p>bin
  csc.7z      Documents  forkbomb    forktime  include       Music     ppid.c  scratch  timefork
  Brackets.Release.1.6.64-bit  csc.tar.gz  Downloads  forkbomb.c  fileSizes.sh  lib           Pictures  Public  share    timefork.c</p>
  
  <pre><code>$ bash fileSizes.sh .
  Going into backup
  Skipping backup.tar.gz
  Skipping bin.tar.gz
  Skipping Brackets.Release.1.6.64-bit.tar.gz
  Skipping csc.7z.tar.gz
  10151 csc.tar.gz
  Skipping csc.tar.gz.tar.gz
  Skipping Desktop.tar.gz
  ...
  Skipping Videos.tar.gz
  Returning to parent
  Going into bin
  Skipping drracket
  Skipping gracket
  Skipping gracket-text
  ...
  Skipping unsplit
  Returning to parent
  Going into Brackets.Release.1.6.64-bit
  Skipping control.tar.gz
  ...
  Returning to parent
  Going into csc
  Skipping rootkey(1).csv
  Skipping rootkey.csv
  154 forkbomb.c
  307200 forkres
  8776 forktime
  533 hw4_2.sh
  Going into IdeaProjects
  Skipping cscsh
  Returning to parent
  ...
  8768 ppid
  524 ppid.c
  8776 timefork
  395 timefork.c
  Going into Videos
  Returning to parent
  </code></pre>
  
  <p>Some prints not listed (...) for the sake of readability.</p>