Thanks for the renaming help.

I had a battle with php3 and lost.  I'm going home.

I've got apache up, with php4 installed.  Php4 scripts work fine.  I've got this 
program I'm trying to use that says it works with php4, yet the files are all named 
*.php3.  Does anyone know what I'm missing for apache setup?  When I click on a .php3 
file, netscape wants to download it.  On a .php file it runs.  I'd like to get it 
working without uninstalling php4 and installing php3 if it's possible (debian 
packages conflict).

I tried renaming every instance within every file of .php3 to .php, and renaming all 
.php3 files to .php.  However the program won't work!  Go figure...

Thanks,
Cory

On Mon, Feb 26, 2001 at 07:04:07PM -0800, Bob Miller wrote:
> Cory Petkovsek wrote:
> 
> > In dos I could type in "ren *.php3 *.php" and rename all the extentions of a glob 
>of files.  In linux, "mv *.php3 *.php" does not work the same.  Anyway to do this?
> > 
> > I thought about
> > for i in *.php3 ; do mv $i ... But I don't know how to delete a character from $i. 
> I can append with $i.php and the like, but that would give me 'index.php3.php'..
> 
> The sh way would be:
> 
>       for i in *.php3
>       do
>               mv $i "`basename \"$i\" 3`"
>       done
> 
> basename is a handy gadget -- read the man page.  See also dirname.
> 
> Also, there is a program in the Perl source distribution, eg/rename,
> which is a more clever rename script.  Using that script, you could
> write:
> 
>       rename 's/3$//' *.php3
> 
> I don't use rename; it feels too much like juggling chainsaws.
> 
> -- 
> Bob Miller                              K<bob>
> kbobsoft consulting
> http://kbobsoft.com                     [EMAIL PROTECTED]

Reply via email to