title: How do I put basename into a variable?
body: <pre><code>#!/bin/bash
  file=debian.deb
  test=basename $file .deb
  DP="blah/blah/$test/$test.php"
  read -p "[$DP]: " DPREPLY
  DPREPLY=${DPREPLY:-$DP}
  echo "Blah is set to $DPREPLY"
  echo $DPREPLY&gt;&gt;testfile
  </code></pre>
  
  <p>So what I'm trying to do is set the variable test from the variable file and use it in the file testfile.</p>