Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP Question

Status
Not open for further replies.

carlg

Programmer
Jun 23, 2004
88
US
I want to use FTP to send files from point A to point B, but I want all of the destination files to be in lower case.

Was wondering if anyone knew a good way to do this.

For example, if my source file is MYFILE.txt, I want it to arrive at the destination as myfile.txt

I am using FTP in a batch mode with all of the commands in an FTP batch file.

Hard coding my FTP batch file is not an option.
For example this is not an option.

put MYFILE.txt myfile.txt

This is because someone who uses my program may call it MYFILE.txt and someone else may call it MYfile.txt

Thanks for the info

Carl

 
Would renaming all files to lowercase prior to ftp'ing be an option?
If so, search the fora here; this has been asked quite a number of times,
e.g. thread80-801998

 
Hi

Then write a script. Something like this :
Code:
(

cat <<EOF
open server
user name
cd directory
EOF

for fi in *.txt; do
  echo "put $fi `echo $fi | tr '[:upper:]' '[:lower:]'`"
done

cat <<EOF
close
quit
EOF

) | ftp

Feherke.
 
The script already has a "Perl Wrap-around," but I was trying to find out if there was a way to have FTP do this for you automatically without depending on Perl to do this.

Thanks

 
Hi

I do not think an FTP clients could do this themself, but I can imagine that some FTP servers have such option or could be extended with a module to do it.

Feherke.
 
Have you tried the case ftp command ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top