<< EOXfer 2>$1 1 ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers << EOXfer 2>$1 1 ?
# 1  
Old 11-16-2006
Question << EOXfer 2>$1 1 ?

Hi all,

First of all, I am new to the UNIX world and I am still learning certain commands.

I found one piece of coding inside a script..
/usr/bin/ftp -invd $HOSTNAME << EOXfer 2>$1 1>> $LOG_FILE
user $USER $PASSWORD
lcd $HOMEDIR
cd $DIRNAME
get $FILENM
quit

EOXfer

Question : can anyone help me to explain what is << EOXfer 2>$1 1 function on this script?

Thank you.
Smilie
# 2  
Old 11-16-2006
Sure,
Code:
/usr/bin/ftp -invd $HOSTNAME << EOXfer 2>$1 1>> $LOG_FILE

Quote:
<< EOXfer - This means that the shell input is read upto the first line that
matches EOXfer and fed as the input to the ftp command

2>$1 - I am a bit confused here. Is it 2>$1 or 2>&1? 2>$1 means that the
standard error of the command (where ftp would output errors or
debug messages) is redirected to the file that is specified in $1
(first argument passed to the script). 2>&1 means that the standard
error is redirected to the standard output.

1>>$LOGFILE - means that the standard output is redirected to the filename
specified in the variable $LOGFILE.
# 3  
Old 11-16-2006
Hi azura,

Just to add to what blowtorch has already mentioned:
EOXfer is no unix command. It is just a pattern used to signify the beginning and end of a "here document" . For that matter, any pattern can be used. You might want to google for "here document" to know more about it.
# 4  
Old 11-17-2006
Thank you so much for the 'lights' on this one!!

Now i can proceed on my next steps.. tq! Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question