FTP file with ( ) + - in the filename


 
Thread Tools Search this Thread
Operating Systems HP-UX FTP file with ( ) + - in the filename
# 1  
Old 07-11-2011
FTP file with ( ) + - in the filename

Hello,
I wnat to transfer files of the following format:

A20110711.1230+0300-1245+0300_BNC46(TEST).4609401144_AREA.xml.gz

Unfortunatelly file transfer works only if aI transmit the files without: + - ( ) characters.

However I can touch files that contains + - not () characters.

Is there a way to transfer these files ?

Thank you in advance.
# 2  
Old 07-11-2011
Try escaping the ( ) with \
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 07-11-2011
The filename appears to be valid in modern FTP and unix. It does contain characters which have special meaning to unix Shell.
If you needed to create such a name in unix bourne-type Shell you would need quotes round the name e.g.:
Code:
touch "A20110711.1230+0300-1245+0300_BNC46(TEST).4609401144_AREA.xml.gz"

I can't see any problem with typing the filename at a FTP prompt but if you were to present it via a Shell Script you must pay attention to stopping Shell from interpreting the special characters (notably the brackets).
e.g.
Code:
my_filename="A20110711.1230+0300-1245+0300_BNC46(TEST).4609401144_AREA.xml.gz"
touch "${my_filename}"

A general warning: It is possible to create all sorts of weird filenames in unix but this does not mean that backup software or applications will be able to deal with them.
I would avoid Shell special characters, control characters and space characters in filenames.
This User Gave Thanks to methyl For This Post:
# 4  
Old 07-12-2011
ftp> put A20110711.1230+0300-1245+0300_BNC46(TEST).4609401144_AREA.xml.gz
200 PORT command successful.
550 A20110711.1230+0300-1245+0300_BNC46(TEST).4609401144_AREA.xml.gz: Permission
denied on server. (Filename (accept))
ftp>

Problem remains :-(
# 5  
Old 07-12-2011
Though this thread is under HP-UX, are both the computers actually running HP-UX? If not, what Operating Systems are they running?
# 6  
Old 07-12-2011
Client (put) is windows therefore I cannot escape \ characters. Server is HP-UX
# 7  
Old 07-12-2011
Quote:
Client (put) is windows therefore I cannot escape \ characters. Server is HP-UX
Please state exact versions of each Operating System.

First impression is that this is either a very old HP-UX or a very old Windows. I tried your filename from modern HP-UX and modern Windows with no problem. This does not in any way mean that I endorse such complex filenames.

Second impression is that the system design is flawed. Just avoid using any character in a filename which is special to either MSDOS or Unix and avoid space characters, hyphens and colons like the plague. Many MSDOS virus scanners will quarantine files containing more than one period character.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Use while loop to read file and use ${file} for both filename input into awk and as string to print

I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix. I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice. Files:... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

2. UNIX for Dummies Questions & Answers

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My Requirement: 1) There are some set of files in a directory like given below OTP_UFSC_20120530000000_acc.csv OTP_UFSC_20120530000000_faf.csv OTP_UFSC_20120530000000_prom.csv... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

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

4. Shell Programming and Scripting

ftp var for filename with spaces

Hello all, I am having difficulties writing an ftp script to retrieve a file via get using a variable name to pass the file name. I know the name of the file I am going to retrieve, this file name has embedded spaces and punctuation in the name itself. If I interactively use the get and I... (10 Replies)
Discussion started by: gio001
10 Replies

5. Shell Programming and Scripting

Filename from splitting files to have the same filename of the original file with counter value

Hi all, I have a list of xml file. I need to split the files to a different files when see the <ko> tag. The list of filename are B20090908.1100-20090908.1200_CDMA=1,NO=2,SITE=3.xml B20090908.1200-20090908.1300_CDMA=1,NO=2,SITE=3.xml B20090908.1300-20090908.1400_CDMA=1,NO=2,SITE=3.xml ... (3 Replies)
Discussion started by: natalie23
3 Replies

6. Shell Programming and Scripting

Deleting File from FTP and Transferring File to FTP

Hi, I am getting error when i am deleting file from FTP and also transferring file from local to FTP server. I am getting 221 error. I am getting this error some time only. Some time the existing file from FTP is deleted and file from local directory is transferred to FTP server. ... (2 Replies)
Discussion started by: praka
2 Replies

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

8. Shell Programming and Scripting

gzcat into awk and then change FILENAME and process new FILENAME

I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies

9. Shell Programming and Scripting

how to put file from one ftp to another ftp location

hi, I have one file located in ftp.I want to place that file in different ftp location. Up to now i am doing it manually using get command and copying that file in to my local system and then putting that file in different ftp using put command. now i want to automate that using shell... (1 Reply)
Discussion started by: prasee
1 Replies

10. 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
Login or Register to Ask a Question