The heredoc format of the ftp line looks wrong. also, you are iterating over a list of files and creating a new ftp connection for each file. Instead use:<br><br>mytemp=$(mktemp -d)<br>mylog=$(mktemp)<br>cp $(cat /chroot/home/fl/fl_sdirc/files.txt) ${mytemp}<br>
cd ${mytemp}<br>ftp -i &lt;host&gt; 2&gt;$1&gt;${mylog} &lt;&lt; EOF<br>user &lt;name&gt; &lt;passwd&gt;<br>binary<br>cd &lt;remote path to file location&gt;<br>mput *<br>exit<br>EOF<br><br><div class="gmail_quote">On Tue, Jan 22, 2013 at 12:18 PM, Chuck Payne <span dir="ltr">&lt;<a href="mailto:terrorpup@gmail.com" target="_blank">terrorpup@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Guys,<br>
<br>
Ok, I think I have a better script, but I am having a problem with the<br>
for/loop with ftp&#39;ing files, looks like it breaking at the &lt;&lt;+<br>
<br>
Here is my new script<br>
<br>
========================Begin Script=================================<br>
<br>
#!/bin/bash<br>
# ftp script<br>
# by Chuck Payne<br>
# ftp, logs, and moves files<br>
<br>
LOG=$(/var/log/fl_sdirc)<br>
FILES=$(cat /chroot/home/fl/fl_sdirc/files.txt | wc -l)<br>
TIME=$(`date &#39;+%m-%d-%Y %H:%M&#39;`)<br>
FILE=$(/chroot/home/fl/fl_sdirc/files.txt)<br>
<br>
<br>
if [ -e $FILE ] ; then<br>
  rm -f $FILE<br>
fi<br>
<br>
ls /chroot/home/fl/fl_sdirc &gt;&gt; /chroot/home/fl/fl_sdirc/files.txt<br>
<br>
if [ $FILE==&quot;0&quot;] ; then<br>
  echo &quot;$TIME&quot; &gt;&gt; $LOG<br>
  echo &quot;No Files tranfer&quot; &gt;&gt; $LOG<br>
else<br>
<br>
for i in `cat /chroot/home/fl/fl_sdirc/files.txt` ; do<br>
  ftp -n 192.168.105.29 &lt;&lt;+<br>
  user flsdir essex<br>
  binary<br>
  put $i<br>
  quit ;<br>
done<br>
<br>
echo &quot;$TIME&quot; &gt;&gt; $LOG<br>
echo &quot;File following file were transfer to Pawnee&quot; &gt;&gt; $LOG<br>
<br>
for i in `cat /chroot/home/fl/fl_sdirc/files.txt` ; do<br>
  echo &quot;$i&quot; &gt;&gt; $LOG<br>
done<br>
<br>
for i in `cat /chroot/home/fl/fl_sdirc/files.txt` ;<br>
  mv $i /home/fl_sdirc/$i.$TIME ;<br>
done<br>
<br>
fi<br>
<br>
<br>
<br>
========================End Script==================================<br>
<br>
<br>
--<br>
Terror PUP a.k.a<br>
Chuck &quot;PUP&quot; Payne<br>
<br>
<a href="tel:%28678%29%20636-9678" value="+16786369678">(678) 636-9678</a><br>
-----------------------------------------<br>
Discover it! Enjoy it! Share it! openSUSE Linux.<br>
-----------------------------------------<br>
openSUSE -- <a href="http://en.opensuse.org/User:Terrorpup" target="_blank">en.opensuse.org/User:Terrorpup</a><br>
openSUSE Ambassador/openSUSE Member<br>
Community Manager -- Southeast Linux Foundation (SELF)<br>
skype,twiiter,identica,friendfeed -- terrorpup<br>
freenode(irc) --terrorpup/lupinstein<br>
Register Linux Userid: 155363<br>
<br>
Have you tried SUSE Studio? Need to create a Live CD,  an app you want<br>
to package and distribute , or create your own linux distro. Give SUSE<br>
Studio a try. <a href="http://www.susestudio.com" target="_blank">www.susestudio.com</a>.<br>
See you at Southeast Linux Fest, June 7-9, 2013 in Charlotte, NC.<br>
<a href="http://www.southeastlinuxfest.org" target="_blank">www.southeastlinuxfest.org</a><br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br><i><i><i><i><br></i></i></i></i>Every time you stop a school, you will have to build a jail. What you 
        gain at one end you lose at the other. It&#39;s like feeding a dog on his 
        own tail. It won&#39;t fatten the dog.<br>

        - Speech 11/23/1900 Mark Twain<br><i><i><i><i><br><a href="http://electjimkinney.org" target="_blank">http://electjimkinney.org</a><br><a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br>
</i></i></i></i>