Scripting question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I'm writing a script that has logging via a simple routine:

LogIt() {
  Msg="$1"
  echo "$THISSCRIPT: $Msg"
  echo "$Msg" >>$LogFile
}

#A portion of this script sends a file via ftp:
#
ftp -vn >$tempfile <<$$EOD
 :
 :
$$EOD
#Then reads the temporary file to log
while read line
  do
    LogIt $line
  Done <$tempfile
rm -f $tempfile
--------------------------------------
All worked fine when I tested the ftp to a temporary file and reading it
back to log the output, but once I created it as a cron entry (or so it
seems) it now seems to take each line up to the first space:

Connected
220-TCP/IP
Copyright
220
Remote
331
230
250
200
local:
227
150-About
  :
  :

See anything I'm doing wrong....any better way of handling this?

TIA,

Frank M. Ramaekers Jr.
Systems Programmer; MCP, MCP+I, MCSE & RHCE
American Income Life Insurance Company 
Phone: (254) 761-6649     Fax: (254) 741-5777


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux