![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | 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 |
| How to get files with a specific extension | janavenki | Shell Programming and Scripting | 9 | 11-27-2007 04:56 PM |
| Feedback: Allow tar.gz extension for files | DukeNuke2 | Post Here to Contact Site Administrators and Moderators | 2 | 08-29-2007 10:22 AM |
| Removing the extension and FTP the files | pradkumar | Shell Programming and Scripting | 1 | 02-14-2007 10:01 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 |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
replace *.sqc files with *.sqC extension
Hi everyone,
I want to know how to replace file extensions. For example how do i go about replacing all *.c files in a directory to *.cpp I think we can do it either with "find" commad or with special registers. I tried to use the following command mv \(.*\).c \1.cpp but it is giving an error saying, cant stat source (.*).c whats wrong with this ? I am not sure how to do it with find commnad. please let me know if anyone of you know how to do it.
__________________
Ramesh Last edited by rameshonline; 04-27-2004 at 01:44 PM. |
| Forum Sponsor | ||
|
|
|
||||
|
Still requires multiple commands, but in the Korn shell, you can do
Code:
for file in *.c; do _file=${file%%.c}.cpp; mv $file $_file; done
That will rename all .c files to .cpp in the current directory. Peace, ZB http://www.zazzybob.com |