Sponsored Content
Full Discussion: FTP - shell script question
Top Forums Shell Programming and Scripting FTP - shell script question Post 302231068 by dennis.jacob on Monday 1st of September 2008 01:01:03 PM
Old 09-01-2008
One option shoud be ..

After copying files to remote server, just before quit the connection, give a ls and capture it in a shell variable.Then, verify the files list from the variable...

ie,

Code:
var=$(ftp xxxx.this is IP address of remote machine.com << EOFFile 
......
...
lcd
ls
quit
EOFfile
)

echo $var

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Not the usual ftp script question

I have an order file that gets updated periodically on a ftp server. The file format is "number one-day of the quarter-file number". For example, the format would look like this for today and would increment as such. 1-26-1 1-26-2 1-26-3 etc After I grab each oder file, I will rename... (9 Replies)
Discussion started by: cstovall
9 Replies

2. Shell Programming and Scripting

using ftp in a shell script.

I am trying to ftp some files from a certain directory, but i got an invalid command. does anybody know why i got this error? ftp -v -i -n <<SCRIPT open servername user username password cd /server/logs for file in MCWAS* do put ${file} /home/test/${file} done bye SCRIPT (2 Replies)
Discussion started by: caesarkim
2 Replies

3. UNIX for Dummies Questions & Answers

Shell script for ftp

Hi ,, I am wrting a shell script to ftp a file from remote server but its giving some problem to me.can you help me in debugging this. #!/usr/bin/ksh HOST="some ip" user="user_name" passwd="password" ftp -n $HOST >>END_SCRIPT USER $user $passwd binary prompt get... (3 Replies)
Discussion started by: namishtiwari
3 Replies

4. Shell Programming and Scripting

ftp with shell script

Can I ftp to put file with shell script(as bath file) ? Plz give the simple code to do that. My script look like that #!/bin/sh echo "Start ftp" ftp temphost <<EOF put file quit EOF # end This code ignore username & password but I need to input. How to input username &... (8 Replies)
Discussion started by: aungomarin
8 Replies

5. UNIX for Advanced & Expert Users

FTP in shell script

HI ALL i am writing a shell script in which i have to use FTP command like. FTP <ip address> cd xyz mget* bye but i am not able to perform any command from shell script. once the control goes to FTP, i again have to type all the things. i just want my shell script to take care of the... (8 Replies)
Discussion started by: infyanurag
8 Replies

6. Shell Programming and Scripting

FTP using shell script

Hi All, I want to make a ftp call using a separate file where the ftp commands will reside. Please find below the details: I have 2 files Sample1.sh and Properties Properties --------- <username> <password> .... other ftp commands Sample1.sh ---------- ftp -v <servername> <... (1 Reply)
Discussion started by: pickpeters
1 Replies

7. Shell Programming and Scripting

Use ftp is a shell script

Hi, What i would like to do is to use a shell script connect to a remote computer and download files from a specific directory. I wrote the following script. #!/bin/sh HOST='IP' USER='yourid' PASSWD='yourpw' FILE='*.txt' REMOTEPATH=/incoming/MSC/ ftp $HOST <<END_SCRIPT user $USER... (3 Replies)
Discussion started by: chriss_58
3 Replies

8. UNIX for Dummies Questions & Answers

FTP shell script

Hi I am new in UNIX field. I don't know if I am posting in right forum or not. And I have also found out that there are so many posts about ftp shell scripting. I have tried those but actually having some problem. Well, my script should do the following..... It finds files( the filename ended... (3 Replies)
Discussion started by: abhishek_510
3 Replies

9. Shell Programming and Scripting

FTP within a SHELL script

I am running the following on linux (on a mac): filename="/Users/thisfilename.txt" hostname="ftp.mysite.com" username="myusername" password="mypassword" echo '=======FTP========' ftp -un $hostname <<EOF quote USER $username quote PASS $password binary put $filename quit EOF I... (4 Replies)
Discussion started by: globalnerds
4 Replies

10. Shell Programming and Scripting

repeating ftp script question

so i got this request to do this: - Script should check for the file ever 15 minutes on the FTP server…if the file is not found, then the whole script exits. File will only be created one a week at random. i have gotten this far, but am kind of stuck, also sleep command doesnt work... (3 Replies)
Discussion started by: zapatur23
3 Replies
RSH(1)							      General Commands Manual							    RSH(1)

NAME
rsh - remote shell SYNOPSIS
rsh [-n] [-l username] host [command] host [-n] [-l username] [command] DESCRIPTION
Rsh connects to the specified host, and executes the specified command. Rsh copies its standard input to the remote command, the standard output of the remote command to its standard output, and the standard error of the remote command to its standard error. Interrupt, quit and terminate signals are propagated to the remote command; rsh normally terminates when the remote command does. The remote username used is the same as your local username, unless you specify a different remote name with the -l option. This remote name must be equivalent (in the sense of rlogin(1)) to the originating account; no provision is made for specifying a password with a com- mand. If you omit command, then instead of executing a single command, you will be logged in on the remote host using rlogin(1). Shell metacharacters which are not quoted are interpreted on local machine, while quoted metacharacters are interpreted on the remote machine. Thus the command rsh otherhost cat remotefile >> localfile appends the remote file remotefile to the localfile localfile, while rsh otherhost cat remotefile ">>" otherremotefile appends remotefile to otherremotefile. OPTIONS
-l username Specify the remote user name. -n Connect standard input of the remote command to /dev/null. Do this if rsh should not inadvertently read from standard input. SEE ALSO
rcp(1), rlogin(1), rhosts(5). BUGS
You cannot run an interactive command (like rogue(6) or vi(1)); use rlogin(1). 4.2 Berkeley Distribution April 29, 1985 RSH(1)
All times are GMT -4. The time now is 06:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy