Sponsored Content
Top Forums Shell Programming and Scripting Use ftp command in shell script Post 302164496 by V3l0 on Tuesday 5th of February 2008 03:52:17 AM
Old 02-05-2008
See the .netrc
 

10 More Discussions You Might Find Interesting

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

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

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

4. Shell Programming and Scripting

problem in exit status of the command in a shell script-FTP

Hi All, I have developed below script for FTP a file from unix machine to another machine. ftpToABC () { USER='xyz' PASSWD='abc' echo "open xx.yy.zbx.aaa user $USER $PASSWD binary echo "put $1 abc.txt" >> /home/tmp/ftp.$$ echo "quit" >> /home/tmp/ftp.$$ ftp -ivn <... (3 Replies)
Discussion started by: RSC1985
3 Replies

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

6. Shell Programming and Scripting

Help with Shell script for FTP

#!/usr/bin/ksh export filename=/grid/PowerCenter/inbound/AT/filelist.txt export SOURCE_DIR=/grid/PowerCenter/inbound/AT export ICOMS_FTP_TGT_DIR1=/dw/input/ATU/ICOM_SERV1 export ICOMS_FTP_TGT_DIR2=/dw/input/AT/ICOM_SERV2 export FILE_MASK="ATRPU_RP_ATU" echo "start" ftp_data_file() { ... (15 Replies)
Discussion started by: vsmeruga
15 Replies

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

8. Shell Programming and Scripting

shell script for ftp files passed in command line argument

i want to write a shell script function that will ftp the files passed in the command line . i have written a shell script for ftp but how will it do for all files passed in command line argument , i am passing 4 files as argument ./ftp.sh file1 file2 file3 file4 code written by me... (5 Replies)
Discussion started by: rateeshkumar
5 Replies

9. Shell Programming and Scripting

FTP command issue in shell script

Hi All I am using following code in my shell script to send the file to a mainframe server. ftp -in $FTP_IP_SEND <<END_OF_FTP >$LOG_DIR/ProviderExportFTP.log quote user $FTP_USER_SEND quote pass $FTP_PASS_SEND ascii send ./ProviderExport.txt 'PROJ.PDRCACTS.FD87050.EXPORT' (REPLACE... (3 Replies)
Discussion started by: Renjith180282
3 Replies

10. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies
netrc(4)						     Kernel Interfaces Manual							  netrc(4)

NAME
netrc, .netrc - Specifies automatic login information for ftp SYNOPSIS
$HOME/.netrc DESCRIPTION
The .netrc file contains the information used by the automatic login (autologin) feature of the ftp command. It is a hidden file in your home directory and must be owned by the user logging in, or by the root user. If the .netrc file contains a login password, the file's permissions must be set to 600 (read and write by owner only). The .netrc file can contain the following entries (separated by spaces, tabs, or newlines): Where host is the name of a remote host. This entry begins the definition of the autologin process for the specified host. All following entries up to the next machine entry or the end of the file apply to that host. This is the same as machine, except that default matches any name. There can be only one default token, and it must appear after all machine tokens. This is normally used as follows: default login anonymous password user@site The preceding command line gives the user automatic anonymous ftp login to machines not specified in .netrc. This can be overriden by using the -n flag to disable autologin. Where user is the username to use at the remote host. If this entry is found, the autologin process initiates a login using the specified name. If this entry is missing, the autologin process fails. Where password is the login password to be used. The autologin process supplies this password to the remote server. A login password must be established at the remote host and that pass- word must be entered in this file, or the autologin process fails and you are prompted for the login password. Where password is the account password to be used. If this entry is found and an account password is required at the remote host, the autologin process supplies the password to the remote server. If the remote host requires an account password but this entry is missing, the autologin process prompts for the account password. Where macro is the name of an ftp subcommand macro. The macro definition starts on the following line and is defined to contain all of the following ftp subcommands up to the next blank line. If the macro is named init, ftp executes the macro upon successful completion of the autologin process. FILES
Contains automatic login information. RELATED INFORMATION
Commands: ftp(1). delim off netrc(4)
All times are GMT -4. The time now is 04:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy