title: ls filename does not work in lftp
body: <p>I created an lftp script to upload single files to a web hosting provider.</p>
  
  <p>The use case is that I call it from the repository root, so the relative path is the same here and in the remote server.</p>
  
  <pre><code>#!/bin/bash
  
  DIRNAME=$(dirname $1)
  FILENAME=$(basename $1)
  REPO_ROOT=$(pwd)
  ABSOLUTE_PATH=${REPO_ROOT}/$1
  
  lftp -u user,passwd -p port sftp://user@hosting &lt;&lt;EOF
  cd $DIRNAME
  put  $ABSOLUTE_PATH 
  ls -l $FILENAME
  quit 0
  EOF
  </code></pre>
  
  <p>It works, with one small but annoying bug. To check that it really uploads the file, I have put an <code>ls -l</code> at the end. It fails and I do not understand why:</p>
  
  <pre><code>ls: Access failed: No such file(functions.php)   
  </code></pre>
  
  <p>I tried to use <code>rels</code> and <code>cache flush</code> but in vain. I'm using lftp 4.0.9.</p>