1753664 Members
5919 Online
108798 Solutions
New Discussion юеВ

FTP and NTRANS

 
JMB_PHP
Advisor

FTP and NTRANS

Have a remote file named "PHP - Monthly_Billing_Activity_BR&A - December 2008_Flat_Format.csv" (without the double quotes) is there a way to get it into something like "BRA_December-2008" during the MGET command?

Then it would easier to then rename and save as 20081231BRA in HPUX
3 REPLIES 3
Steven Schweda
Honored Contributor

Re: FTP and NTRANS

So far as I know, mget does not give you a
chance to supply any destination names.

"man ftp".

If you insist on using mget, I see no way to
get a different name, other than to rename it
after it arrives. (Or change the name at the
source. Or create a link there with the
desired name, ...)
JMB_PHP
Advisor

Re: FTP and NTRANS

Sorry, didn't mean to state rename from FTP. What I need it to remove/change the embedded spaces,hypen and underscores. They create problems (for me) in programs when trying to rename in HPUX to something like "BRA_December-2008"
Steven Schweda
Honored Contributor

Re: FTP and NTRANS

Use quotation marks or apostrophes?

bash$ echo fred > 'a b c d'
bash$ ls -l
total 0
-rw-r----- 1 SMS 40 5 Jan 26 15:40 a b c d
bash$ mv 'a b c d' a_b_c_d
bash$ ls -l
total 0
-rw-r----- 1 SMS 40 5 Jan 26 15:40 a_b_c_d

Why do you think that "-" and "_" cause
trouble?

bash$ echo fred > 'a b c d e'
bash$ src='a b c d e'
bash$ dst=` echo "$src" | sed -e 's/ /_/g' `
bash$ echo $dst
a_b_c_d__e
bash$ mv "$src" "$dst"
bash$ ls -l
total 0
-rw-r----- 1 SMS 40 5 Jan 26 15:45 a_b_c_d__e