title: shell script : appending directory path and filename
body: <p>I want to copy a file from a directory using shell script</p>
  
  <p>Suppose I save the directory and file name seperately as</p>
  
  <pre><code>dir=/home/user/directory/
  file=file_1
  </code></pre>
  
  <p>to copy the file Im using this command in my script</p>
  
  <pre><code>cp $dir$file .
  </code></pre>
  
  <p>But I get this error</p>
  
  <pre><code>/bin/cp omitting directory '/home/user/directory'
  </code></pre>
  
  <p>I have tried all combination eg. omitted the trail backslah from variable dir, etc but nothings working. I cant understand what is wrong with this code. Pleas help</p>
  
  <p>Maybe the command <code>$dir$file</code> is not getting unpacked in the shell (ie only the directory variable is getting unpacked, not the file variable)!!!!!</p>