mv *.htm *.html????

mv *.htm *.html????

Post by Erik Arno » Thu, 02 Feb 1995 19:14:35



Hello. As you can tell I am new to UNIX. I am trying to
change my DOS .htm files to .html on the UNIX server.
The mv *.htm *.html command is not working. What is the
command? Thanks,
===============================================================
Erik Arnold

http://ftn.net/~earnold/basket/
===============================================================
 
 
 

mv *.htm *.html????

Post by Adrian Powe » Fri, 03 Feb 1995 01:28:07



>Hello. As you can tell I am new to UNIX. I am trying to
>change my DOS .htm files to .html on the UNIX server.
>The mv *.htm *.html command is not working. What is the
>command? Thanks,

There isn't a command, so far as I know.  Try something like this:

(appologies for the ugly way of doing this - there is probably
a way around the system call, but I'm only learning :)

#!/usr/local/bin/perl

while(<*.htm>)
{
    system("mv $_ $_l");

Quote:}

--

Home Page            http://ugweb.cs.ualberta.ca/~adrian
Humor Collection     http://gpu.srv.ualberta.ca/~apowell/humor.html
H. R. Giger Gallery  http://gpu.srv.ualberta.ca/~apowell/giger/giger.html

 
 
 

mv *.htm *.html????

Post by Marcus B. Irv » Fri, 03 Feb 1995 05:35:39



>Hello. As you can tell I am new to UNIX. I am trying to
>change my DOS .htm files to .html on the UNIX server.
>The mv *.htm *.html command is not working. What is the
>command? Thanks,

you can do this in the Korn shell (if you are running csh or
something just type ksh to invoke the Korn shell and type exit when
you are done) by:

$ for fn in $(ls *.htm)

Quote:> do
> mv $fn ${fn}l
> done

Marcus

--
Marcus B. Irven                               University of Illinois

**Team OS/2**    <a href="http://www.cen.uiuc.edu/~mirven>Home Page</a>
"Keep it simple: as simple as possible, but no simpler." A. Einstein

 
 
 

mv *.htm *.html????

Post by Logan Sh » Sat, 04 Feb 1995 07:59:35






>>Subject: mv *.htm *.html????
>>Date: Wed, 01 Feb 95 10:14:35 EST

>>Hello. As you can tell I am new to UNIX. I am trying to
>>change my DOS .htm files to .html on the UNIX server.
>>The mv *.htm *.html command is not working. What is the
>>command? Thanks,
>>===============================================================
>>Erik Arnold

>>http://www.veryComputer.com/~earnold/basket/
>>===============================================================
>you can set up a soft link to the file and never have to rename it again with

>ln -s *.htm *.html

>would create a link from the *.html to the *.htm file.  If you are constantly
>uploading from ms-dos this would save you the rename step

I think the user wants to rename a >group< of files ending in *.htm to
files.  In that case, the easy way to do it is:

        find . -name '*.htm' -exec 'mv {} {}l' \;

Adios,
  Logan
--
Logan Shaw, Unix Systems Administrator
"everybody / loves to see / justice done / on somebody else" (Bruce*burn)

 
 
 

mv *.htm *.html????

Post by Logan Sh » Sat, 04 Feb 1995 08:02:47





>>Hello. As you can tell I am new to UNIX. I am trying to
>>change my DOS .htm files to .html on the UNIX server.
>>The mv *.htm *.html command is not working. What is the
>>command? Thanks,

>There isn't a command, so far as I know.  Try something like this:

>(appologies for the ugly way of doing this - there is probably
>a way around the system call, but I'm only learning :)

>#!/usr/local/bin/perl

>while(<*.htm>)
>{
>    system("mv $_ $_l");
>}

Well, if you're going to use perl, no need to use system().  Just do
this:

        #! /usr/local/bin/perl

        while (<*.htm>)
                {
                rename ($_, $_ . "l");
                }

Adios,
  Logan
--
Logan Shaw, Unix Systems Administrator
"everybody / loves to see / justice done / on somebody else" (Bruce*burn)

 
 
 

mv *.htm *.html????

Post by David W. Tamk » Sat, 04 Feb 1995 08:29:35



| you can do this in the Korn shell (if you are running csh or
| something just type ksh to invoke the Korn shell and type exit when
| you are done) by:
|
| $ for fn in $(ls *.htm)
| > do
| > mv $fn ${fn}l
| > done

Marcus likes to make sure his system gets its exercise.  This does the
job with less work:

  for fn in *.htm
  do
  mv $fn ${fn}l
  done

 
 
 

mv *.htm *.html????

Post by Tommy Warei » Sun, 05 Feb 1995 01:54:17



Quote:>you can set up a soft link to the file and never have to rename it again
with

>ln -s *.htm *.html

>would create a link from the *.html to the *.htm file.

No, you can't. For starters, what *.html file.
For seconds, ln takes two filenames as parameters, and this gives
(eg) 10 .htm filenames, followed (you hope) by 10 .html filenames (which
it wont, because of the first problem.

foreach i (*.htm)
mv $i $i:r.html
end

--
 _________________________   __________________________________________
/  Tommy Wareing          \ /  I've been looking for an original sin,  \

\  0865-483389            / \     -- Pandora's Box, Jim Steinman       /
 ~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 
 
 

mv *.htm *.html????

Post by Larry Fishm » Thu, 02 Feb 1995 22:13:57




>Subject: mv *.htm *.html????
>Date: Wed, 01 Feb 95 10:14:35 EST
>Hello. As you can tell I am new to UNIX. I am trying to
>change my DOS .htm files to .html on the UNIX server.
>The mv *.htm *.html command is not working. What is the
>command? Thanks,
>===============================================================
>Erik Arnold

>http://ftn.net/~earnold/basket/
>===============================================================

you can set up a soft link to the file and never have to rename it again with

ln -s *.htm *.html

would create a link from the *.html to the *.htm file.  If you are constantly
uploading from ms-dos this would save you the rename step

Larry.

 
 
 

mv *.htm *.html????

Post by Kari E. Hurt » Sun, 05 Feb 1995 23:30:35


;       find . -name '*.htm' -exec 'mv {} {}l' \;

Don't work.




{} {}l
--
- Kari E. Hurtta                             /  Eldmd on monimutkaista


 
 
 

mv *.htm *.html????

Post by Sean Ch » Mon, 06 Feb 1995 17:26:16




>;   find . -name '*.htm' -exec 'mv {} {}l' \;

>Don't work.

Under tcsh, I use

foreach i (*.htm)
        > mv $i $i'l'
        > end

Maybe not pretty, but it works (at least it did for me).

---

 
 
 

mv *.htm *.html????

Post by Vincent Zoonekyn » Sun, 12 Feb 1995 23:11:26




> ? find . -name '*.htm' -exec 'mv {} {}l' \;

> Don't work.

Indeed, it cannot work.
As far as I remember, {} must be one entire argument.
You cannot append 'l' to it.

The simplest and most general solution is a PERL one:
      rename 's/\.htm$/\.html/' **/*.htm
(where **/*.htm is zsh syntax)

It allows you to rename in any way you yant a series of files.

rename is the following PERL script:

#!/usr/local/bin/perl

#
# Examples :
#
#  rename 's/\.orig$//' *.orig
#  rename 'y/A-Z/a-z/ unless /^Make/' *
#  rename '$_ .= ".bad"' *.f
#  rename 'print "$_:", s/foo/bar/ if <STDIN ~= /^y/;'
#  find /tmp -name '*~' -print | rename 's/^(.+)~$/.#$1/'
#

($op=shift) || die "Usage : rename expr [files]\n (for some examples, see the code)\n";



{
    $was = $_ ;
    eval $op;

    rename($was, $_) unless $was eq $_ ;

Quote:}


 
 
 

mv *.htm *.html????

Post by Chris Anders » Sat, 18 Feb 1995 06:18:39



: >

: > ?       find . -name '*.htm' -exec 'mv {} {}l' \;
: >
: > Don't work.
: >

[ snip ]

I think an easier solution than that is a simple bourne shell script that
looks something like this:

#!/bin/sh
for i in *.htm
do
mv $i ${i}l
done

--
Chris Anderson                  |   Sex,                      
University of Texas at Austin   |   *,

 
 
 

mv *.htm *.html????

Post by Kristofor A Varh » Sat, 18 Feb 1995 12:58:12





: : >

: : > ?     find . -name '*.htm' -exec 'mv {} {}l' \;
: : >
: : > Don't work.
: : >

: I think an easier solution than that is a simple bourne shell script that
: looks something like this:

: #!/bin/sh
: for i in *.htm
: do
: mv $i ${i}l
: done

Of course, you're going to want to replace *.htm in this script with
something like `find . -name '*.htm' -print`.

--
Kristofor A. Varhus                  

Engineering and Applied Science
University of Pennsylvania

 
 
 

mv *.htm *.html????

Post by Steve Drisco » Sat, 18 Feb 1995 22:52:06






: : : >

: : : > ?   find . -name '*.htm' -exec 'mv {} {}l' \;
: : : >
: : : > Don't work.
: : : >

: : I think an easier solution than that is a simple bourne shell script that
: : looks something like this:

: : #!/bin/sh
: : for i in *.htm
: : do
: : mv $i ${i}l
: : done

: Of course, you're going to want to replace *.htm in this script with
: something like `find . -name '*.htm' -print`.

All this is correct, but I'm willing to bet that this is an expedient approach
to the problem of serving hypertext html files to the mosaic user.
If this is the case, just edit the mime.types file in the httpd's conf
directory and add .htm to the line:

text/html    .html

so that it looks like

text/html   .html .htm

Then restart the httpd server and you'll get your .htm files as hypertext
and not ascii.  ( I assume that the .htm is because the files are being
authored on a PC and that the need to change the name would be a continual
PITA.

 
 
 

1. mv *.htm *.html



I guess the basename of {} is ""...

foreach file (*.htm)
mv $file ${file:r}.html
end

ksh:
for file in *.htm ; do
mv $file ${file%.htm}.html
done

or, in this case, in both shells
mv $file ${file}l
in the body of the loop...

Christian
--
Christian Bauernfeind
Not speaking for Siemens
Not even working for IBM

2. : Nice prompt, please

3. Using a wildcard: convert *.htm to *.html

4. stress testing the PowerMac G3

5. matching *.html and *.htm with one pattern

6. Source for Linux Real Audio player available??

7. Apache: *.htm and *.html

8. how to find out child processes

9. Changing *.htm to *.html

10. How do I <4dos>ren *.htm *.html</4dos> in bash?

11. Redirect *.htm to *.html

12. *.html or *.htm

13. Apache: *.html and *.htm