03-07-2006
Althought this is more complicated ,u can try:
for EXT_FILE in $(ftp -n ${HOST} < files.ftp | grep -vE "^Passive|^total" |grep -v active|awk -F\SCA '{print $2}')
do
echo ${EXT_FILE} >>files_ext-list.tmp
done
cat files_ext-list.tmp|while read EXT_FILE
do
EXT_FILE2="$(echo ${EXT_FILE}|awk -F\_ '{print $1}')_in.txt"
echo "define(EXT_FILE,${EXT_FILE}) define(EXT_FILE2,${EXT_FILE2})" > out.macros
cat out.macros download_files.ftp | m4 -B64556 > temp.ftp
ftp -n ${HOST} < temp.ftp
done
Where:
cat files.ftp
user username password
passive
dir
bye
cat download_files.ftp
user username password
passive
get "SCA""EXT_FILE" "SCA""EXT_FILE2"
bye
Cheers
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Well the title is not too good, so I will explain.
I need to move (rename) files using a simple AIX script.
???file1.txt
???file2.txt
???file1a.txt
???file2a.txt
to be:
???renamedfile1'date'.txt
???renamedfile2'date'.txt
???renamedfile1a'date'.txt
???renamedfile2a'date'.txt
... (4 Replies)
Discussion started by: grimace15
4 Replies
2. UNIX for Dummies Questions & Answers
Hi Unix gurus,
Maybe it is too much to ask for but please take a moment and help me out. A very humble request to you gurus. I'm new to Unix and I have started learning Unix. I have this project which is way to advanced for me.
File format: CSV file
File has four columns with no header... (8 Replies)
Discussion started by: arvindosu
8 Replies
3. UNIX for Dummies Questions & Answers
I have a script where I have the command
sed "s/$search_string/$replace_string/g" $backup
However I want a command to correct the original file $backup as well as creating another file with the changes which I have in my script already. In other words, I want to touch the orginal file also... (1 Reply)
Discussion started by: alis
1 Replies
4. Shell Programming and Scripting
QUESTION1:
How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed.
Contents of car.txt
CAR1_KEY0
CAR1_KEY1
CAR2_KEY0
CAR2_KEY1
CAR1_KEY10
CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1
grep... (1 Reply)
Discussion started by: thibodc
1 Replies
5. Shell Programming and Scripting
Im stumped on this one. Id like to echo into a .txt file all names for an xml feed in a huge folder. Can that be done?? Id need to echo <name>This name</name> in client.xml files.
$path="/mnt/windows/path"
echo 'recording names'
cd "$path"
for names in $path
than Im stuck on... (2 Replies)
Discussion started by: graphicsman
2 Replies
6. Shell Programming and Scripting
Hello
Below is my requirement
I have 3 files A1.txt , A2.txt and A3.txt . A2 is dynamically generating file
I want the merge of A1,A2 and A3 in A2.txt
Could you please help? (3 Replies)
Discussion started by: Pratik4891
3 Replies
7. Shell Programming and Scripting
Hi,
I am trying to find out the original file size of an encrypted file in SunOS.
The file was decrypted with gpg command.
I want to know the size of the orginal file without decrypting it. I am using the below command, but it is not working for big files(more than 1 GB).
gpg --passphrase... (4 Replies)
Discussion started by: vsachan
4 Replies
8. Shell Programming and Scripting
Hi All,
Is there is any machanisim, once delete the file can we restore it.
Thanks (8 Replies)
Discussion started by: bmk123
8 Replies
LEARN ABOUT DEBIAN
ftp_geturl
ftp::geturl(3tcl) ftp client ftp::geturl(3tcl)
__________________________________________________________________________________________________________________________________________________
NAME
ftp::geturl - Uri handler for ftp urls
SYNOPSIS
package require Tcl 8.2
package require ftp::geturl ?0.2.1?
::ftp::geturl url
_________________________________________________________________
DESCRIPTION
This package provides a command which wraps around the client side of the ftp protocol provided by package ftp to allow the retrieval of
urls using the ftp schema.
API
::ftp::geturl url
This command can be used by the generic command ::uri::geturl (See package uri) to retrieve the contents of ftp urls. Internally it
uses the commands of the package ftp to fulfill the request.
The contents of a ftp url are defined as follows:
file The contents of the specified file itself.
directory
A listing of the contents of the directory in key value notation where the file name is the key and its attributes the asso-
ciated value.
link The attributes of the link, including the path it refers to.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category ftp of
the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
SEE ALSO
ftpd, mime, pop3, smtp
KEYWORDS
ftp, internet, net, rfc 959
CATEGORY
Networking
ftp 0.2.1 ftp::geturl(3tcl)