renaming mass file extensions (HELP), in Debian Linux |
|
Porsche, and the Porsche crest are registered trademarks of Dr. Ing. h.c. F. Porsche AG.
This site is not affiliated with Porsche in any way. Its only purpose is to provide an online forum for car enthusiasts. All other trademarks are property of their respective owners. |
|
renaming mass file extensions (HELP), in Debian Linux |
bd1308 |
Apr 7 2005, 11:38 AM
Post
#1
|
Sir Post-a-lot Group: Members Posts: 8,020 Joined: 24-January 05 From: Louisville,KY Member No.: 3,501 |
I know what i want to do...i have a bizillion .php files i need to get to be .php3 files....so my logic is like this:
rm *.php *.php3 but of course, that dont work....... please somebody help (IMG:http://www.914world.com/bbs2/html/emoticons/pray.gif) |
tat2dphreak |
Apr 7 2005, 12:50 PM
Post
#2
|
||
stoya, stoya, stoya Group: Benefactors Posts: 8,797 Joined: 6-June 03 From: Wylie, TX Member No.: 792 Region Association: Southwest Region |
cool!!! (IMG:http://www.914world.com/bbs2/html/emoticons/beer.gif) weird it gave that error though... I learned it on the job... ksh is basically a way to string together common unix commands... "echo" "cut" "cp" are just unix commands, you can look at their man page (cut is one of the most powerful tools in string manipulation... a file name is just a string when you think about it... the "for x in *php" basically creates an array of all the file names(strings) and loops through them 1 by 1... from there you just "create" your new file name(string) by taking the first part of the file_name (cut command, -d means 'delimited' by what ever character you put after it, -f tells it what "field" # you want of it)... then the cp command actually looks at the variable x as a file(instead of a string) and copies the x (original) file to the new(bname.php3) name |
||
Lo-Fi Version | Time is now: 8th June 2024 - 07:39 AM |
All rights reserved 914World.com © since 2002 |
914World.com is the fastest growing online 914 community! We have it all, classifieds, events, forums, vendors, parts, autocross, racing, technical articles, events calendar, newsletter, restoration, gallery, archives, history and more for your Porsche 914 ... |