title: Bash function to ls absolute path (but behaves like ls)
body: <p>I am trying to write a bash function that follows the same behavior as ls, but it displays the full path instead of the relative one. What I have written so far is the following:</p>
  
  <pre><code>ls_abs()
  {
      if [ -z "$1" ]
      then
          ls -d -1 $PWD/*
      else
          ls -d -1 $PWD/${1}
      fi
  }
  </code></pre>
  
  <p>Calling <code>ls_abs</code> seems to work just fine, but when I try to call it with a wildcard argument (<code>ls_abs thisdir/that*/anotherdir/*.log</code>, for example), for some reason it will only output one line. Can someone help me to understand what I am doing wrong here?</p>