Sponsored Content
Full Discussion: passing value through ftp
Top Forums Shell Programming and Scripting passing value through ftp Post 302268654 by ali560045 on Tuesday 16th of December 2008 04:50:21 AM
Old 12-16-2008
using dir i m able to get the file name but how to copy it using FTP

Code:
#!/bin/ksh
set -x

cd /ednadtu3/u01/pipe/naveed/class
echo "Enter the month/day"
read value

ftp -n ddcappip031.tu.com << "EOF"
user amit jason
prompt
cd /ednpdtu7/u01/pipe/Incoming/CurrentCollector/MeterReads/backupfiles
dir CurrentCollectorMeterReadBackup2008????.tar.gz
bye
EOF

output
---------------------------------

+ cd /ednadtu3/u01/pipe/naveed/class
+ echo Enter the month/day
Enter the month/day
+ read value
1020
+ ftp -n ddcappip031.tu.com
+ 0< /tmp/sh3616862.2
Interactive mode off.

-rw-r----- 1 pipe pipe 79895161 Nov 19 23:05 CurrentCollectorMeterReadBackup20081119.tar.gz
-rw-r----- 1 pipe pipe 70604904 Nov 20 23:04 CurrentCollectorMeterReadBackup20081120.tar.gz
-rw-r----- 1 pipe pipe 70907652 Nov 21 23:05 CurrentCollectorMeterReadBackup20081121.tar.gz
-rw-r----- 1 pipe pipe 72986381 Nov 22 23:05 CurrentCollectorMeterReadBackup20081122.tar.gz
-rw-r----- 1 pipe pipe 68609570 Nov 23 23:04 CurrentCollectorMeterReadBackup20081123.tar.gz
-rw-r----- 1 pipe pipe 69937900 Nov 24 23:05 CurrentCollectorMeterReadBackup20081124.tar.gz
-rw-r----- 1 pipe pipe 70518963 Nov 25 23:05 CurrentCollectorMeterReadBackup20081125.tar.gz
-rw-r----- 1 pipe pipe 69788932 Nov 26 23:05 CurrentCollectorMeterReadBackup20081126.tar.gz
-rw-r----- 1 pipe pipe 70712364 Nov 27 23:04 CurrentCollectorMeterReadBackup20081127.tar.gz
-rw-r----- 1 pipe pipe 69530103 Nov 28 23:04 CurrentCollectorMeterReadBackup20081128.tar.gz
-rw-r----- 1 pipe pipe 69359582 Nov 29 23:04 CurrentCollectorMeterReadBackup20081129.tar.gz
-rw-r----- 1 pipe pipe 70377462 Nov 30 23:04 CurrentCollectorMeterReadBackup20081130.tar.gz
-rw-r----- 1 pipe pipe 71530553 Dec 1 23:05 CurrentCollectorMeterReadBackup20081201.tar.gz
-rw-r----- 1 pipe pipe 71315927 Dec 2 23:05 CurrentCollectorMeterReadBackup20081202.tar.gz
-rw-r----- 1 pipe pipe 71014908 Dec 3 23:05 CurrentCollectorMeterReadBackup20081203.tar.gz
-rw-r----- 1 pipe pipe 70006001 Dec 4 23:05 CurrentCollectorMeterReadBackup20081204.tar.gz
-rw-r----- 1 pipe pipe 72596207 Dec 5 23:05 CurrentCollectorMeterReadBackup20081205.tar.gz
-rw-r----- 1 pipe pipe 71755813 Dec 6 23:05 CurrentCollectorMeterReadBackup20081206.tar.gz
-rw-r----- 1 pipe pipe 71804873 Dec 7 23:05 CurrentCollectorMeterReadBackup20081207.tar.gz
-rw-r----- 1 pipe pipe 70321940 Dec 8 23:06 CurrentCollectorMeterReadBackup20081208.tar.gz
-rw-r----- 1 pipe pipe 71836264 Dec 9 23:05 CurrentCollectorMeterReadBackup20081209.tar.gz
-rw-r----- 1 pipe pipe 70717052 Dec 10 23:06 CurrentCollectorMeterReadBackup20081210.tar.gz
-rw-r----- 1 pipe pipe 73818543 Dec 11 23:05 CurrentCollectorMeterReadBackup20081211.tar.gz
-rw-r----- 1 pipe pipe 72596215 Dec 12 23:05 CurrentCollectorMeterReadBackup20081212.tar.gz
-rw-r----- 1 pipe pipe 71104767 Dec 13 23:05 CurrentCollectorMeterReadBackup20081213.tar.gz
-rw-r----- 1 pipe pipe 70855212 Dec 14 23:05 CurrentCollectorMeterReadBackup20081214.tar.gz
-rw-r----- 1 pipe pipe 87294203 Dec 15 23:07 CurrentCollectorMeterReadBackup20081215.tar.gz

-----------------------------------------------------

Last edited by ali560045; 12-16-2008 at 06:05 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

passing ip address as a variable to script for ftp

Still a Beginner here .. Does anyone no how to get the IP address of the machine thats logged in (bearing in mind there will be others logged in) while they are logged in to the Unix server and pass this as a variable to a shell script so as I can FTP files to that machine via a shell script, at... (2 Replies)
Discussion started by: Gerry405
2 Replies

2. Shell Programming and Scripting

Random parameters passing in FTP script

Hi I have a question. In the FTP script if we are passing all the required value like Hostname, username, password, Action(put or get), Filename, & mode(ascii or binary) through parameters then we have to pass these in the exact orders in which they are taken like if we defined Username=$2... (2 Replies)
Discussion started by: sourabhshakya
2 Replies

3. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

4. UNIX for Advanced & Expert Users

MVS->Unix FTP : Using chmod as part of FTP.

We are transferring file from mainframes to unix, & in FTP process itself we would like to set access rights for unix machine. Has anyone used chmod command in association with site command in ftp? How it should be used? Thanks in advance. (1 Reply)
Discussion started by: videsh77
1 Replies

5. UNIX for Advanced & Expert Users

Using FTP to check whether file is completely FTP... plz find the description below

Hi, We have some clients who will place huge files in to one of the remote server. And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients. My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies

6. Shell Programming and Scripting

passing parameter to ftp script from output of another ftp

Hi, I have a ftp script which first gets all the file names and echo's the latest file. I'm using another ftp command sets to get the file name given by first ftp. The problem is the parameter is not accepted by second ftp. The error message i'm getting is > Rename Temp File calloc:ICMP... (5 Replies)
Discussion started by: ammu
5 Replies

7. Shell Programming and Scripting

Automated FTP script using .netrc to multiple FTP servers

Hi all, I'm using the following script to automated ftp files to 1 ftp servers host=192.168.0.1 /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine 192.168.0.1 login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

8. Shell Programming and Scripting

FTP command line username and password passing

Dear All, I am new to unix and I am trying to build a shell script which will connect to a different server by passing username and password from a file or command line but not manually... In short I dont want to connect to a diff server via ftp interactively. Any suggestion...looking... (8 Replies)
Discussion started by: Pratik4891
8 Replies

9. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

10. Shell Programming and Scripting

Reading a string and passing passing arguments to a while loop

I have an for loop that reads the following file cat param.cfg val1:env1:opt1 val2:env2:opt2 val3:env3:opt3 val4:env4:opt4 . . The for loop extracts the each line of the file so that at any one point, the value of i is val1:env1:opt1 etc... I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies
escape(1)							Mail Avenger 0.8.3							 escape(1)

NAME
escape - escape shell special characters in a string SYNOPSIS
escape string DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result. EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string: $ var='; echo gotcha!' $ eval echo hi $var hi gotcha! $ Using escape, one can avoid executing the contents of $var: $ eval echo hi `escape "$var"` hi ; echo gotcha! $ A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient: #!/bin/sh formail -x to -x cc -x resent-to -x resent-cc | fgrep "$1" > /dev/null && exit 0 echo "<$1>.. address does not accept blind carbon copies" exit 100 To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt script: bodytest reject_bcc `escape "$RECIPIENT"` SEE ALSO
avenger(1), The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 escape(1)
All times are GMT -4. The time now is 10:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy