FTP inv tee Query


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP inv tee Query
# 1  
Old 10-06-2008
FTP inv tee Query

Hi,

This is part of a ftp script, Can someone please explain what is its functionality or the basic idea behind it and please throw some light on the inv & tee function marked in red.

echo "bye" ) |
ftp -inv | tee -a ${DOWNLOAD_LOG} | awk '{ print $0 } /^5[0-9[0-9].*/ { print "\n\t\t\tFTP session had some errors" }' | awk '/^2[0-9][0-9][- ]You.*/ { print "\n\t\t\t"substr($0,5) }'


Thanks
Sparks
# 2  
Old 10-07-2008
Quote:
Originally Posted by openspark
Hi,

This is part of a ftp script, Can someone please explain what is its functionality or the basic idea behind it and please throw some light on the inv & tee function marked in red.

echo "bye" ) | ftp -inv | tee -a ${DOWNLOAD_LOG} | awk '{ print $0 } /^5[0-9[0-9].*/ { print "\n\t\t\tFTP session had some errors" }' | awk '/^2[0-9][0-9][- ]You.*/ { print "\n\t\t\t"substr($0,5) }'


Thanks
Sparks
i think there are few more echo statements before echo "bye"
all that are piped to ftp command in ftp -i -n -v are option gothrough the man page of ftp. and the o/p of ftp is appended to the logfile tee -a will append to the exsisting file then log file is checked for any error in ftp..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mindboggling difference between using "tee" and "/usr/bin/tee" in bash

I'm on Ubuntu 14.04 and I manually updated my coreutils so that "tee" is now on version 8.27 I was running a script using bash where there is some write to pipe error at some point causing the tee command to exit abruptly while the script continues to run. The newer version of tee seems to prevent... (2 Replies)
Discussion started by: stompadon
2 Replies

2. UNIX for Beginners Questions & Answers

Perform SQL query then FTP

Hi All, Would like to ask if its possible to perform sql query in another machine and then the output will be sent back to local via ftp. Machine1 - home server Machine2 - 2nd server Scenario: will perform sql query in Machine2 then put it into temp table then the temp table will be... (2 Replies)
Discussion started by: znesotomayor
2 Replies

3. Shell Programming and Scripting

FTP Query

Hi, I have to migrate the scripts from source(HP UX) to destination(Linux) some files. While ftp and downloading the files, the permissions of the files are changing. Is there any option in ftp to get the file in exact permissions. I believe we can achieve it by using tar, however i am... (3 Replies)
Discussion started by: nag_sathi
3 Replies

4. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

5. Shell Programming and Scripting

Query related to ftp script

Hi, I was planning to write a FTP script that will FTP files to destination folder. All configuration should be done through a properties files, I have developed two files under /home/499633/scripts) scripts folder, and my main file(ftp_script.sh) should read the properties from the properties... (2 Replies)
Discussion started by: rahul125
2 Replies

6. UNIX for Advanced & Expert Users

Purpose of inv

Hi All Can anybody tell me what is the purpose of inv in the below command. ftp -inv $RFTPSERVER /temp/te.txt << EOF and << its stands for what.. Thanks (1 Reply)
Discussion started by: raju4u
1 Replies

7. Shell Programming and Scripting

Using tee

I have been using the command tee to store the output to a file and also write on the terminal. However I would need to put the program in the background although I would still need to see the file being updated like it was doing when using tee. Any suggestions on how to look at the log file... (3 Replies)
Discussion started by: kristinu
3 Replies

8. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies

9. Shell Programming and Scripting

KSH n FTP query

Hi, I have this slightly modified FTP code (thanks to this forum) function gather_FTPDate { HOST= USER= PASSWD= exec 4>${TEMP_LOG_FILE} ftp -nv >&4 2>&4 |& echo $? if ] then echo "Unable to connect to FTP server!!!" >> ${LOG_FILE} return 0 fi print -p open... (2 Replies)
Discussion started by: psynaps3
2 Replies

10. UNIX for Advanced & Expert Users

FTP query

Hi there, Can anyone tell me how to use FTP so that I can pipe a text file with FTP commands in. I'd like to use this method in my korn shell so that I can log onto a remote server and collate listings of specific files. Here's what I'm trying to do: ftp -v host_server < ftp_command_file ... (1 Reply)
Discussion started by: csong2
1 Replies
Login or Register to Ask a Question