![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| "sed" to check file size & echo " " to destination file | jockey007 | Shell Programming and Scripting | 7 | 04-28-2009 03:08 AM |
| Sed , Replace a "variable text" inside of a statement | jackn7 | Shell Programming and Scripting | 4 | 03-04-2008 03:40 PM |
| Running Windows "inside" a Linux-like OS? | heliotos | Linux | 6 | 12-27-2007 12:38 AM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-20-2007 01:52 AM |
| "syntax error at line 21 :'done' unexpected." error message" | ibroxy | Shell Programming and Scripting | 3 | 08-08-2007 07:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
"unexpected end of file" when Iīm use EOF inside block if
I have a trouble in my script when i use EOF inside block if.
If i use EOF whitout block if I donīt have problem. Guys any ideas? Sorry for my terrible English. #!/bin/sh set -xv HOST='ftp.fiction.com.br' USER='fictionuser' PASS='fictionpass' FILE='ftpteste.txt' busca=`find ftpteste.txt`; if [ "$busca" = "$FILE" ]; then echo Okay File it exists ftp -v -n $HOST <<-EOF quote USER $USER quote PASS $PASS put $FILE quit EOF else echo Donīt have file in the folder fi exit |
|
|||||
|
Quote:
Code:
#!bin/sh
set -xv
HOST='ftp.fiction.com.br'
USER='fictionuser'
PASS='fictionpass'
FILE='ftpteste.txt'
if [ -f $FILE ]; then
echo "OK file exists"
if [ -r $FILE ]; then
echo "OK file is readable"
ncftpput -u $USER -p $PASS $HOST . $FILE 2>&1 /dev/null
if [ $? -ne 0 ]; then
echo "Error uploading file"
else
echo "OK file uploadet"
fi
else
echo "Error file is unreadable"
fi
else
echo "Error file does not exist"
fi
Last edited by redhead; 03-26-2008 at 04:57 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|