10-28-2005
how to rename a file before and after a ftp?
I doin a script in sh.
For example:
i have this code here whereby $5 is a text file. eg file.txt. I wanna rename it to file.txt.tmp. so i use this code below which is correct.
put $5 $5.tmp
But when the ftp transfer is complete i need to rename the file back to $5 which is file.txt.
How do i do that?
izzit use
mv $5.tmp $5?
i got problem with that...
Thanks in advance for those who help.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi there,
I hope someone can help me with this problem :
I have a directory (/var/www/file/imgprofil) which contains about 10000 JPG files. They have a naming convention thus :
prefix-date-key-suffix.jpg
they all have the prefix p-20050608-
then AAAA is a 4 letter code
the suffix is... (7 Replies)
Discussion started by: steve7
7 Replies
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
hi friends,
I writing a script to psot dataset to ceratin server.....while doing ftp I have to rename the file while which is in present server like
present :test server
filename data.097878.
ftp server: it sholu be renamed as data.097878.zip
thanks,
The thing is that while... (1 Reply)
Discussion started by: Nagabhushan
1 Replies
4. Shell Programming and Scripting
Hi All,
I want to rename set of files in the remote server which iam unable to do . i can rename only one file
at a time . for example
ftp $REMOTESERVER
{
rename $NAME1 $NAME2
} is working
whereas
ftp $REMOTESERVER
{
rename $NAME1*.dat $NAME2*.data
} is not working ...... (4 Replies)
Discussion started by: dineshr85
4 Replies
5. UNIX for Advanced & Expert Users
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
6. HP-UX
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
7. UNIX for Dummies Questions & Answers
I have one input file ABC.txt and one output DEF.txt. After the ABC is processed and created output, I want to rename ABC.txt to ABC.orig and DEF to ABC.txt. Currently when I am doing this, it does not process the input file as it cannot read and write to the same file. How can I achieve this?
... (12 Replies)
Discussion started by: High-T
12 Replies
8. Shell Programming and Scripting
I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies
9. UNIX for Dummies Questions & Answers
I have to ftp and rename the file with #finished# extension after successfully transfer. In some environments the command rename ABCD.dat ABCD.#finished# is working fine, but some environments its not working, I have to use escape character something like : rename ABCD.dat ABCD.\#finished\#
Why is... (3 Replies)
Discussion started by: srikanth38
3 Replies
10. Shell Programming and Scripting
In the below bash I am trying to copy the only text file (always only one) in /home/cmccabe/Desktop/list/QC/metrics.txt and rename each of the 3 text files according to /home/cmccabe/Desktop/test/list.txt using lines 3, 4 ,5. This format (that is list.txt) is always 5 lines. Thank you :).
... (12 Replies)
Discussion started by: cmccabe
12 Replies
LEARN ABOUT MOJAVE
zipnote
zipnote(1) General Commands Manual zipnote(1)
NAME
zipnote - write the comments in zipfile to stdout, edit comments and rename files in zipfile
SYNOPSIS
zipnote [-w] [-b path] [-h] [-v] [-L] zipfile
ARGUMENTS
zipfile Zipfile to read comments from or edit.
OPTIONS
-w Write comments to a zipfile from stdin (see below).
-b path
Use path for the temporary zip file.
-h Show a short help.
-v Show version information.
-L Show software license.
DESCRIPTION
zipnote writes the comments in a zipfile to stdout. This is the default mode. A second mode allows updating the comments in a zipfile as
well as allows changing the names of the files in the zipfile. These modes are described below.
EXAMPLES
To write all comments in a zipfile to stdout use for example
zipnote foo.zip > foo.tmp
This writes all comments in the zipfile foo.zip to the file foo.tmp in a specific format.
If desired, this file can then be edited to change the comments and then used to update the zipfile.
zipnote -w foo.zip < foo.tmp
The names of the files in the zipfile can also be changed in this way. This is done by following lines like
"@ name"
in the created temporary file (called foo.tmp here) with lines like
"@=newname"
and then using the -w option as above.
BUGS
The temporary file format is rather specific and zipnote is rather picky about it. It should be easier to change file names in a script.
Does not yet support large (> 2 GB) or split archives.
SEE ALSO
zip(1), unzip(1)
AUTHOR
Info-ZIP
v3.0 of 8 May 2008 zipnote(1)