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
Whatch that rm command there buddy! Whoah! Slow down with the * too! You will open yourself up for massive removing of files.
Try mv -i so things will even prompt if they will overwrite something else.
QUOTE (Root_Werks @ Apr 7 2005, 11:54 AM) |
Whatch that rm command there buddy! Whoah! Slow down with the * too! You will open yourself up for massive removing of files. :o Try mv -i so things will even prompt if they will overwrite something else. ;) |
do this: (ksh scripting):
for x in *php
do
bname = $(echo $x |cut -d. -f1)
cp $x ${bname}.php3
done
then verify everything lookas as it should and mv the old php files into a temp directory to make sure the functionality still works
QUOTE (tat2dphreak @ Apr 7 2005, 12:02 PM) |
do this: (ksh scripting): for x in *php do bname = $(echo $x |cut -d. -f1) cp $x ${bname}.php3 done then verify everything lookas as it should and mv the old php files into a temp directory to make sure the functionality still works |
QUOTE (bd1308 @ Apr 7 2005, 01:05 PM) | ||
|
QUOTE (tat2dphreak @ Apr 7 2005, 12:16 PM) | ||||
I use unix @ work daily... you can script a lot of things right on the command line... I use Perl (not the same perl though, file manipulation) and Korn daily... lemme know how it works for you |
Yes, just keep typing. When you hit return after the done, it will go.
Oh, and this will copy all of those files to .php3 versions, so you need to delete the .php versions after it runs and you check things. You could skip that step by replacing the cp with mv in the next to last line. Wayne's version is the safe/paranoid version.
tmi:/var/www/phpBB2/admin# for x in *php
> do
> bname = $(echo $x |cut -d. -f1)
> cp $x ${bname}.php3
> done
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
bash: bname: command not found
tmi:/var/www/phpBB2/admin#
QUOTE (bd1308 @ Apr 7 2005, 01:23 PM) | ||
well the problem is i don't know how to get that to come back up .....I'm excited to get this to work tho!!!! |
nevermind....it worked!!!!! yea! thank you all....now you all have to tell me hwo to learn all of this stuff
QUOTE (bd1308 @ Apr 7 2005, 01:36 PM) |
i didnt see that you replied....i just tried it but it didnt work...i have a clip[ped section from my ssh session^^it's above |
QUOTE (bd1308 @ Apr 7 2005, 10:36 AM) |
nevermind....it worked!!!!! yea! thank you all....now you all have to tell me hwo to learn all of this stuff |
QUOTE (bd1308 @ Apr 7 2005, 01:36 PM) |
nevermind....it worked!!!!! yea! thank you all....now you all have to tell me hwo to learn all of this stuff |
yeah, well if it weren't a bad day....my phpbb board software doesn't work...as i had hoped it would.....so back to the drawing board i suppose....what does parse error mean?
QUOTE (lapuwali @ Apr 7 2005, 01:45 PM) | ||
Buy a book on ksh from O'Reilly. Buy another book on Perl, also from O'Reilly. After you get started, buy one of the "Cookbook" volumes from them, and you'll find recipes for all kinds of commonly done things. Unix is Unix, for the most part, and it's been around for nearly 40 years, ksh and Perl for 20 years, so there's lots of published knowledge on how to use this stuff. |
i'm done with linux for awhile...i have a linode, and i wanted to put phpbb2 on there but every freaking time i try to access it, i get a download window.....what in the hell am i doing wrong?
QUOTE (bd1308 @ Apr 7 2005, 02:19 PM) |
i'm done with linux for awhile...i have a linode, and i wanted to put phpbb2 on there but every freaking time i try to access it, i get a download window.....what in the hell am i doing wrong? |
what cool thing can i do on linux....cool random thing.
Whew! Well, since everything is in a temp file, I would try something like this from the directory in which your files reside:
mv -i *.php /home/temp/new_files/*.php3
Then you can:
ls -l /home/temp/new_files/* > /home/temp/new_files/list.txt
ls -l > list1.txt
Compare the two list files to make sure nothing is missing.
okay....did apt-get install php4 to get php4....figured it didnt work with php3 so i migth as well upgrade..done
dumped entire /phpBB2 to /trash....can't figure out how to delete whole non-empty dir's tho.
next i'm going to print out my httpd.conf file and look through that to see if i left traces of php3 in there....
files are now needing to be named .php, but i was trying everything to see if any combo worked.
nothing works rigth now, seems as if .php isnt recignized as an actual executable file to apache...but i dont see a module to load in httpd.conf
QUOTE (Root_Werks @ Apr 7 2005, 02:33 PM) |
Whew! Well, since everything is in a temp file, I would try something like this from the directory in which your files reside: mv -i *.php /home/temp/new_files/*.php3 Then you can: ls -l /home/temp/new_files/* > /home/temp/new_files/list.txt ls -l > list1.txt Compare the two list files to make sure nothing is missing. |
QUOTE (bd1308 @ Apr 7 2005, 02:39 PM) |
okay....did apt-get install php4 to get php4....figured it didnt work with php3 so i migth as well upgrade..done dumped entire /phpBB2 to /trash....can't figure out how to delete whole non-empty dir's tho. next i'm going to print out my httpd.conf file and look through that to see if i left traces of php3 in there.... files are now needing to be named .php, but i was trying everything to see if any combo worked. nothing works rigth now, seems as if .php isnt recignized as an actual executable file to apache...but i dont see a module to load in httpd.conf |
QUOTE (tat2dphreak @ Apr 7 2005, 11:43 AM) | ||
I don't think that mv will work the way you used it... if so, it doesn't work for me under HP UNIX.. I just set up a test to try it, using a copy of my sql directory and a temp dir under it... razor:MED:/home/wf6341/temp_sql-> mkdir test razor:MED:/home/wf6341/temp_sql-> mv -i *.sql ./temp/*.sq1 Usage: mv [-f] [-i] [-e warn|force|ignore] f1 f2 mv [-f] [-i] [-e warn|force|ignore] f1 ... fn d1 mv [-f] [-i] [-e warn|force|ignore] d1 d2 razor:MED:/home/wf6341/temp_sql-> |
This looks a lot like work!
From a bash shell command line (which is probably what you're running out of the box in Linux):
ls *.php | awk -F. '{print $1}'|while read file; do mv $file.php $file.php3; done
QUOTE (bd1308 @ Apr 7 2005, 01:39 PM) |
okay....did apt-get install php4 to get php4....figured it didnt work with php3 so i migth as well upgrade..done dumped entire /phpBB2 to /trash....can't figure out how to delete whole non-empty dir's tho. next i'm going to print out my httpd.conf file and look through that to see if i left traces of php3 in there.... files are now needing to be named .php, but i was trying everything to see if any combo worked. nothing works rigth now, seems as if .php isnt recignized as an actual executable file to apache...but i dont see a module to load in httpd.conf |
well i might just have to do that anyway, as i still don't feel confident in my php installation abilities.
QUOTE (bd1308 @ Apr 7 2005, 12:36 PM) |
nevermind....it worked!!!!! yea! thank you all....now you all have to tell me hwo to learn all of this stuff |
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)