|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Need to Change File name in Script
I have to ftp 4 files from one server to another.
These files are formatted as zcced.f1.o1.d333.d3333 the only difference with these files is the last four digits. Once I ftp them I have to take the file with HDr 166 as the begin line and change it to a zcced.f1.ou.d333.d3333. The other 3 files I will delete. Can anyone help me on how to change to file name? Right now I'm using the find command which gets me the file I want but I don't know how to use that info to change to file name. |
|
#2
|
|||
|
|||
|
Yes. You can use find command to find the file and use to change the name of filename as,
find <path> -type f -name "filename" -exec cp {} <newfilename> \; where, collected file is noted as {} -exec cp {} <newfilename> \; will copy the filename. If you want to fully move then use mv command there. You can use any shell command on -exec <command> <filename> \; there. HTH. REgards, Muthukumar. |
|
#3
|
|||
|
|||
|
Thanks
It worked great thanks for your help
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Need to Change File name in Script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|