title: How do I get rid of : line 1: /backup: Is a directory, error message?
body: <p>I'm trying to create a shell script which displays for a given directory the months of the last modification of its files in a sorted order.</p>
  
  <p>I got it working except, I keep getting this message: script.sh: line 1: /backup: Is a directory</p>
  
  <p>How do I get rid of this code?</p>
  
  <p>My code:</p>
  
  <pre><code>#!/bin/bash
  
  echo "Enter directory name: "
  read d
  ls $d -l | awk '{print $6}' | sort 
  </code></pre>