On Jun 26, 2008, at 15:42, [EMAIL PROTECTED] wrote:
I was trying to script a solution for this purely in lftp, but I have not been able to find an easy way of renaming the files. After i mput the lot (all called *.tmp), i would like to rename them all fromfilename.tmp to filename.xml (as we are only uploading xml-files).Currently I have solved this by a bash script, which uploads and the renames every file one by one. This causes the opening of a connection for every file we wish to transfer though, at least as far as I know.
I don't think it's possible inside lftp, but it's easy enough to pipe your command list from bash to a single invocation of lftp, which then execute all the commands in a single session:
for i in *.xml; do \
t="${i%.*}".tmp; \
echo put \'"$i"\' -o \'"$t"\' '&&' mv \'"$t"\' \'"$i"\'; done \
| lftp your-server-here
