FTP inside a block of code


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP inside a block of code
# 1  
Old 12-21-2005
FTP inside a block of code

I need help on the code below. I am getting a compile error
syntax error at line 283 : `<<' unmatched

Looks like it doesn't like the << on the ftp line below. If I ran the code outside of this block everything work fine, but when I put in a block of code or in a function, I got syntax error. I wrote these codes in ksh.
if [ ${agentCount} -eq 1 ]
then
echo "Going to ftp ${DATAPATH}${AGTFILE}.asc"

ftp -i -v ${JQFTPSERVER} << EOF >> ${ftpout}

cd to_jq
pwd
ascii
prompt
put ${DATAPATH}${AGTFILE}.asc

bye
EOF
fi
# 2  
Old 12-21-2005
I found the solution to my problem. the problem was I indent EOF and it should be at the first position on the left.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Search a string inside a pattern matched block of a file

How to grep for searching a string within a begin and end pattern of a file. Sent from my Redmi 3S using Tapatalk (8 Replies)
Discussion started by: Baishali
8 Replies

2. UNIX for Dummies Questions & Answers

Add a block of code at the end of a specific block

I need to search for a block with the starting pattern say "tabId": "table_1", and ending pattern say "]" and then add a few lines before "]" "block1":"block_111" "tabId": "table_1", "title":"My title" ..... .... }] how do I achieve it using awk and sed. Thanks, Lakshmi (3 Replies)
Discussion started by: Lakshmikumari
3 Replies

3. Shell Programming and Scripting

Need to FTP a file from Dev to Tst inside UNIX server

Hi I have a requirement that need to ftp a file from 10.192.36.203(dev) to 10.192.36.36 (tst) ,need to write a shell script for that .Plz help Thanks in advance. (1 Reply)
Discussion started by: sandqwerty
1 Replies

4. Shell Programming and Scripting

How to redirect the output of a command inside ftp block?

hi, i am using ftp to get files from remote server. inside the ftp i want to us ls -ltr command and send the output of it to a file. ftp -n remote_server <<_FTP quote USER username quote PASS password prompt noprompt pwd ls -ltr get s1.txt bye _FTP i... (4 Replies)
Discussion started by: Little
4 Replies

5. Shell Programming and Scripting

How to use chmod command inside ftp block?

hi, i want to use chmod command inside ftp. so that what ever files are transfered to the local server will hav 664 permission. if i use chmod inside ftp , the file permissions gets changed in the remote server and when the file is transffered to local server using get command, it does not... (8 Replies)
Discussion started by: Little
8 Replies

6. UNIX for Dummies Questions & Answers

How to write code inside ssh block in shell?

Hi, I am new to shell script. I am trying to code on shell script but not able to find the correct syntax to write the code once it comes inside ssh. For eg: ssh -q HOST " SwapInUse=\`vmstat -nm | (while read; do echo "$(date +%Y%m%d.%H%M%S) $REPLY"; done) | tail -n +3 | awk '{print... (5 Replies)
Discussion started by: Yagami
5 Replies

7. Shell Programming and Scripting

FTP Command inside If condition

Hi All, I am facing a alien problem in unix shell script. i have a requirement where i have to check first whether a particular file has been created or not if that file has been created then that file needs to be ftped to a particular dir. My Code is like that Success='code for file... (3 Replies)
Discussion started by: aryan_styles
3 Replies

8. Shell Programming and Scripting

How to use ftp commands inside shell script? Help please

Dears, I'm new in shell scripting and i need your help, i would like to know how can i create a script to ftp to a certain unix/linux machine/server IP address and get a file for example without user intervention? How can i force the script to use a certain username and password to access this... (4 Replies)
Discussion started by: Dendany83
4 Replies

9. Shell Programming and Scripting

ftp files inside a shell script

I have a shell script where I am trying to ftp some files but I get the error message "EOF unclosed" every time the script reaches the ftp section. Here is how my script is written. #more code up here rm -f $object >> $LOG_FILE 2>&1 fi #end of if done #end of for loop ... (5 Replies)
Discussion started by: matrix1067
5 Replies

10. Cybersecurity

iptables: block/allow ftp

I have 2 LAN's, seperated by a firewall, running iptables on it. I want only allow ftp access from one to the other LAN. Server 1 in LAN 1 should have ftp access to Server 2 in LAN 2 Server 2 in LAN 2 should not have ftp access to Server 1 in LAN 1. Can someone tell me how to set up the... (5 Replies)
Discussion started by: sTorm
5 Replies
Login or Register to Ask a Question