![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| removing the extension from all filenames in a folder | johnmcclintock | UNIX for Dummies Questions & Answers | 5 | 05-21-2008 05:23 AM |
| removing particular lines ending with a .cnt extension in a text file | ramky79 | SUN Solaris | 2 | 03-03-2008 01:17 AM |
| Feedback: Allow tar.gz extension for files | DukeNuke2 | Post Here to Contact Site Administrators and Moderators | 2 | 08-29-2007 10:22 AM |
| How to test for files with a particular extension. | jyotipg | UNIX for Dummies Questions & Answers | 1 | 05-09-2002 04:04 AM |
| How to list files will no extension | Wing m. Cheng | UNIX for Dummies Questions & Answers | 5 | 02-21-2002 10:34 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Removing the extension and FTP the files
Hi All
I am having around 100 files like: a.xml.done a.xml b.xml.done b.xml .... Now I need to remove .done extension from the above and FTP the remaining files. Totally there are 100 files. How to accomplish this |
| Forum Sponsor | ||
|
|
|
|||
|
If you remove the .done extension then you create two files with the same name, based on your list of files.
This removes the .done from files in the current directory. Code:
find ./ -prune -type -f -name '*.done' |\
while read file
newfile=${file%%.done}
mv $file $newfile
done
|
|||
| Google The UNIX and Linux Forums |