Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Dec 1998 18:51:29 -0600
From:      David Kelly <dkelly@HiWAAY.net>
To:        "James A. Taylor" <jataylor@lundahl.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Basic mv question? 
Message-ID:  <199812120051.SAA49424@n4hhe.ampr.org>
In-Reply-To: Message from "James A. Taylor" <jataylor@lundahl.com>  of "Fri, 11 Dec 1998 09:29:42 MST." <36714876.A3B825A4@lundahl.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
"James A. Taylor" writes:
> I have a directory tree full of *.shtml files.
> I assumed that I could recursively rename all of
> the *.shtml files in that directory tree to *.html
> files.  When I tried I got a usage message and
> from what I can tell the FreeBSD commands
> mv and cp do not take wild cards.

Very few Unix commands accept wildcards. The reason being is the
wildcards are expanded and command line parsed by the shell before the
command is loaded in memory. VMS and MS-DOS expected the command line 
to be parsed and wildcards expanded in the application/command. The 
following shell script might help demonstrate. The variable $* is the 
invoking argument list:

#!/bin/sh
echo $*

I called it "args" and it looks like this when run:

%  sh args this is a test /usr/ports/l* duh
this is a test /usr/ports/lang duh

So what I'm really trying to say is I'm concerned about the likelyhood 
you have lost some of your files when you tried to mv them.

% mv -i *.shtml *.html
mv: No match.
% touch junk.shtml
% !mv
mv -i *.shtml *.html
usage: mv [-f | -i] source target
       mv [-f | -i] source ... directory
% touch trash.html
% !mv
mv -i *.shtml *.html
overwrite trash.html? (y/n [n]) n
not overwritten
% ls -l *tml
-rw-r--r--  1 dkelly  dkelly  0 Dec 11 18:45 junk.shtml
-rw-r--r--  1 dkelly  dkelly  0 Dec 11 18:46 trash.html
% touch another.shtml
!mv
mv -i *.shtml *.html
usage: mv [-f | -i] source target
       mv [-f | -i] source ... directory
% !ls
ls -l *tml
-rw-r--r--  1 dkelly  dkelly  0 Dec 11 18:48 another.shtml
-rw-r--r--  1 dkelly  dkelly  0 Dec 11 18:45 junk.shtml
-rw-r--r--  1 dkelly  dkelly  0 Dec 11 18:46 trash.html
%

Looks like you are safe after all.

--
David Kelly N4HHE, dkelly@nospam.hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812120051.SAA49424>