Commands not executing after FTP in shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Commands not executing after FTP in shell script
# 1  
Old 04-13-2012
Commands not executing after FTP in shell script

Hello

In the shell script we have a FTP command like below

Code:
 
ftp -n -v -q winftp.principal.com >/infa/datafiles/GRP/Scripts/ftp_from_infa_dvcn.log<<END_SCRIPT
 
quote USER $FTP_USER
quote PASS $FTP_PASS 
ascii
lcd $FTP_LOCALDIR
cd $FTP_FLDR
put $FTP_FILE
 
bye
exit

If i want to execute any unix commands after exit command its not executing
I tried with removing the exit command at the end and tried to run unix command but its still not executing
Tried like below
Code:
 
 
lcd $FTP_LOCALDIR
cd $FTP_FLDR
put $FTP_FILE
 
bye
rm $FTP_FILE

But the rm command didnt execute
Please let me know how to resolve the issue
# 2  
Old 04-13-2012
you need to end the here statement
Code:
 
ftp -n -v -q winftp.principal.com >/infa/datafiles/GRP/Scripts/ftp_from_infa_dvcn.log<<END_SCRIPT
 
quote USER $FTP_USER
quote PASS $FTP_PASS 
ascii
lcd $FTP_LOCALDIR
cd $FTP_FLDR
put $FTP_FILE
 
bye
END_SCRIPT
exit

This User Gave Thanks to itkamaraj For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Open Source

Shell script file movement to a Mail Box server using ftp commands

Hi All, I have a current Process that runs "windows script " for the file movement that needs to changed to a "DataStage Process (Using shell script )" Source :Text file is getting generated as part of Datastage Jobs processes and resides in a shared drive (Unix server) Target :ftp... (2 Replies)
Discussion started by: developer.dwh9
2 Replies

2. Homework & Coursework Questions

What are different ways of executing shell commands?

I am a student in BCIT in vancouver and taking comp2771 course.(Shell scripting). I would like to know what are different ways of executing shell commands? Thanks (1 Reply)
Discussion started by: adam25ca
1 Replies

3. Shell Programming and Scripting

Executing a shell script containing awk commands

Hi All, I am trying to execute a shell script containg awk commands. But unable to do so. Below is my script. Please help. The name of the script is scan.sh and I have tried executing it using the command sh scan.sh It is giving an error which reads like: awk:syntax error near line 7... (3 Replies)
Discussion started by: misb
3 Replies

4. UNIX for Dummies Questions & Answers

how to stay in remote shell after executing commands in ssh?

the ssh calling convention: ssh <server> If I put commands in the section, ssh will execute them immediately after logging in and return to local shell. I want to stay in the remote shell after executing these commands. How can I achieve this? Thanks for all. (1 Reply)
Discussion started by: hplonlien
1 Replies

5. Shell Programming and Scripting

Executing commands through shell variable

Hey there, I am trying to pass a command as argument to a function. The command shows up in $1. Now I want to execute this command, but if I do a $1 ./sample "bla/blaprintf: warning: ignoring excess arguments, starting with `bla/bla' The code is : #!/bin/ksh fn() { $1 } fn... (3 Replies)
Discussion started by: shriyer
3 Replies

6. Shell Programming and Scripting

executing commands through FTP session

Dears, i want to execute unix commands through FTP session those commands like grep XXXXX file name > new file tar new file ..... etc Please let me know how to so thank you (3 Replies)
Discussion started by: faiz
3 Replies

7. 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

8. UNIX for Advanced & Expert Users

Executing shell script from Windows FTP

Hello, Any inputs on the possibility of executing a shell script on unix box from Windows FTP TIA (1 Reply)
Discussion started by: B2BIntegrator
1 Replies

9. UNIX for Advanced & Expert Users

executing commands in child shell

I have to execute some commands after executing one command ( cleartool setview Tagname) Problem is that I write commands in script like this. echo "test1" cleartool setview tagname echo "test2" copy file1 file2 echo "test3" but when I execute script. Output --------- test1 If I... (1 Reply)
Discussion started by: udaykishore
1 Replies

10. UNIX for Dummies Questions & Answers

FTP - Executing Commands

I have written a script to ftp a file from Unix to an NT machine to authenticate ftp login I have added the information into the .netrc file when logged in using ftp the commands are not executed. Does anybody know how to make the command execute once username and password have been provided using... (2 Replies)
Discussion started by: hesmas
2 Replies
Login or Register to Ask a Question