[comp.sys.amiga.introduction] Wildcards in the CLI

grmg6820@uxa.cso.uiuc.edu (Geoffrey R. Mason) (04/16/91)

I would like to know what wildcards I can use when opening a new CLI with
the workbench Shell command...  For example, I know that I can use the "?"
as a single character wildcard, but how about a string?  Also, are there any
PD programs that would allow me to make is so that I could type something like
	DELETE *.TXT
to remove all files with extension .txt?
--
Geoffrey R. Mason		|	grmg6820@uxa.cso.uiuc.edu
Department of Psychology	|	gmason@s.psych.uiuc.edu
University of Illinois		|	x9999bng@maple.circa.ufl.edu

s902113@minyos.xx.rmit.oz.au (Luke Mewburn) (04/17/91)

grmg6820@uxa.cso.uiuc.edu (Geoffrey R. Mason) writes:

>I would like to know what wildcards I can use when opening a new CLI with
>the workbench Shell command...  For example, I know that I can use the "?"
>as a single character wildcard, but how about a string?  Also, are there any
>PD programs that would allow me to make is so that I could type something like
>	DELETE *.TXT
>to remove all files with extension .txt?

Try DELETE #?.TXT

As '?' is the single char wildcard, '#' is the "take the next char and
match if it occurs >=0 times, '#?' is the generic wildcard match.

  remember.
	
	#?    ==   *

Anyway, if you are running WB1.3, get ARP (its PD). It is heaps better than
C= (and faster, and smaller etc,etc :-). It's wildcard's are also like
Unix, (ie, uses the '*')
>--
>Geoffrey R. Mason		|	grmg6820@uxa.cso.uiuc.edu
>Department of Psychology	|	gmason@s.psych.uiuc.edu
>University of Illinois		|	x9999bng@maple.circa.ufl.edu
-- 

------------------------------------------------------------------------
| Luke Mewburn   (Zak)                |     This side for rent...      |
| s902113@minyos.xx.rmit.oz.au        |                                |

rjlov@ecr.mu.oz.au (Richard James LOVEJOY) (04/17/91)

	In article <1991Apr16.155231.18782@ux1.cso.uiuc.edu>, grmg6820@uxa.cso.uiuc.edu (Geoffrey R. Mason) writes:
> I would like to know what wildcards I can use when opening a new CLI with
> the workbench Shell command...  For example, I know that I can use the "?"
> as a single character wildcard, but how about a string?  Also, are there any
> PD programs that would allow me to make is so that I could type something like
> 	DELETE *.TXT
> to remove all files with extension .txt?

	The CLI uses the # to mean "any number of the next character". So 
#? means "any number of" "any character". Thus, you can use "delete #?.txt"
to remove all files with extension .txt.

dvljrt@cs.umu.se (Joakim Rosqvist) (04/17/91)

In article <1991Apr16.155231.18782@ux1.cso.uiuc.edu> grmg6820@uxa.cso.uiuc.edu (Geoffrey R. Mason) writes:
>I would like to know what wildcards I can use when opening a new CLI with
>the workbench Shell command...  For example, I know that I can use the "?"
>as a single character wildcard, but how about a string?  Also, are there any
>PD programs that would allow me to make is so that I could type something like
>	DELETE *.TXT
>to remove all files with extension .txt?
>--
To delete all file with extension .txt just type:
1> delete #?.txt
#? stands for any number of any char, just like * in MS-DOS, though in 
amigados it can match a period as well.
/$DR.HEX$

mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) (04/17/91)

In article <1991Apr17.013825.9354@minyos.xx.rmit.oz.au> s902113@minyos.xx.rmit.oz.au (Luke Mewburn) writes:
   Anyway, if you are running WB1.3, get ARP (its PD). It is heaps better than
   C= (and faster, and smaller etc,etc :-). It's wildcard's are also like
   Unix, (ie, uses the '*')

Be warned that, while ARP tries to be 100% compatable with CBM, it
doesn't quite make it. There are vendor reports that complex
installation scripts fail when run under Arp.

Also, using '*' breaks the fastest editor on the Amiga.

	<mike

--
That time we slept together				Mike Meyer
That's as far as it went				mwm@pa.dec.com
Yet though we're not quite lovers			decwrl!mwm
You're more than a friend

dbscoop2@bwdlh417.BNR.CA (Las Lovas) (04/19/91)

In article <7384@munnari.oz.au>, rjlov@ecr.mu.oz.au (Richard James
LOVEJOY) writes:
|>
|>	In article <1991Apr16.155231.18782@ux1.cso.uiuc.edu>,
grmg6820@uxa.cso.uiuc.edu (Geoffrey R. Mason) writes:
|>> I would like to know what wildcards I can use when opening a new CLI with
|>> the workbench Shell command...  For example, I know that I can use the "?"
|>> as a single character wildcard, but how about a string?  Also, are
there any
|>> PD programs that would allow me to make is so that I could type
something like
|>> 	DELETE *.TXT
|>> to remove all files with extension .txt?
|>
|>	The CLI uses the # to mean "any number of the next character". So 
|>#? means "any number of" "any character". Thus, you can use "delete #?.txt"
|>to remove all files with extension .txt.
            
If you get ARP, you can use the * wildcard.  All the arp commands and
associated library routines understand it.  Under 2.0, you can run a
program called "starburst" which sets some bit which allows the use of
the * wildcard.  The problem stems from the fact that C= (in their
infinite wisdom) decided to use * to refer to the console device
(STDIO), so they had to have a different convention for wildcards than
the "standard" UNIX and (dare I day it...) Messydos conventions.

daveh@cbmvax.commodore.com (Dave Haynie) (04/24/91)

In article <6512@bwdls58.bnr.ca> dbscoop2@bwdlh417.BNR.CA (Las Lovas) writes:

>The problem stems from the fact that C= (in their infinite wisdom) decided to
>use * to refer to the console device (STDIO), so they had to have a different
>convention for wildcards than the "standard" UNIX and (dare I day it...) 
>Messydos conventions.

Well, not quite.  MS-DOS and UNIX don't have an equivalent for # in their
pattern specification languages.  So it would be just as confusing to the
person who's refusing to lean AmigaDOS to have * as a direct replacement for
# as it would be for them to learn # in the first place.  The Apollo computer
Domain/OS (nee Aegis) actually does this; in that system, * works very much 
like #, only it's a postfix, not a prefix (eg, "#?" in AmigaDOS matches "?*" 
in Apollo).

Also, I should point out that the behavior of * is by no means standard; it
works differently in UNIX, MS-DOS, VAX/VMS, C64/C128 DOS, etc.  Under the
Amiga OS, #? means the same as * under UNIX.  And as mentioned, in 2.0, there
is a kludge in dos.library that equates * to #? if you ask for it.  

Personally, I can't see any more logic for * in AmigaDOS than I can for
:= in C language or a "Park" setting on a 5-Speed manual transmission.  They
are different critters, and once you learn what you're doing, you're happier
than resorting to either complaints or kludges.  Obviously, if you're just
starting out, this IS something to learn, but a very minor piece when compared
to what else is out there to pick up.




-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
      "That's me in the corner, that's me in the spotlight" -R.E.M.

groenewo@fwi.uva.nl (Ferry van het Groenewoud) (04/25/91)

daveh@cbmvax.commodore.com (Dave Haynie) writes:

>In article <6512@bwdls58.bnr.ca> dbscoop2@bwdlh417.BNR.CA (Las Lovas) writes:

>>The problem stems from the fact that C= (in their infinite wisdom) decided to
>>use * to refer to the console device (STDIO), so they had to have a different
>>convention for wildcards than the "standard" UNIX and (dare I day it...) 
>>Messydos conventions.

>Well, not quite.  MS-DOS and UNIX don't have an equivalent for # in their
>pattern specification languages.  So it would be just as confusing to the
>person who's refusing to lean AmigaDOS to have * as a direct replacement for
># as it would be for them to learn # in the first place.  The Apollo computer
>Domain/OS (nee Aegis) actually does this; in that system, * works very much 
>like #, only it's a postfix, not a prefix (eg, "#?" in AmigaDOS matches "?*" 
>in Apollo).

>Also, I should point out that the behavior of * is by no means standard; it
>works differently in UNIX, MS-DOS, VAX/VMS, C64/C128 DOS, etc.  Under the
>Amiga OS, #? means the same as * under UNIX.  And as mentioned, in 2.0, there
>is a kludge in dos.library that equates * to #? if you ask for it.  

>Personally, I can't see any more logic for * in AmigaDOS than I can for
>:= in C language or a "Park" setting on a 5-Speed manual transmission.  They
>are different critters, and once you learn what you're doing, you're happier
>than resorting to either complaints or kludges.  Obviously, if you're just
>starting out, this IS something to learn, but a very minor piece when compared
>to what else is out there to pick up.

MY problem with the #? wildcard is, that it are TWO characters, and, as everyone
figured out, a * is only ONE character. Add to this the unhandy place they are
at on the keyboard, makes the use of it at least twice as unhandy as using *.

Something else that is ofcourse very annoying about wildcards is that not all
doscommands handle them but I believe that has been fixed in 2.0 (hasn't it?!)

Ferry.

>-- 
>Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
>   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
>      "That's me in the corner, that's me in the spotlight" -R.E.M.

--
Mac.   The noise of a wrong calibration.    PS/2.  You can't see the new thing.
IBM.   The toys of a dead generation.       Sun.   You can't feel the beating.
NeXT.  The choice cause of bad information. Atari. You'll need some healing.
                                           
Amiga. For boys with real imagination.  __  Amiga. You can reach the ceiling.
                                     __/ /
Ferry van het Groenewoud             \__/  groenewo@fwi.uva.nl  

daveh@cbmvax.commodore.com (Dave Haynie) (05/03/91)

In article <1991Apr25.100919.21595@fwi.uva.nl> groenewo@fwi.uva.nl (Ferry van het Groenewoud) writes:

>MY problem with the #? wildcard is, that it are TWO characters, and, as everyone
>figured out, a * is only ONE character. Add to this the unhandy place they are
>at on the keyboard, makes the use of it at least twice as unhandy as using *.

I never found it a problem myself, I suppose that's a matter of personal
perference.  I do find the additional power of the Amiga wildcard language
relative to that of other systems worth any extra effort involved.  Of course,
I've been using this system since 1985.

>Something else that is ofcourse very annoying about wildcards is that not all
>doscommands handle them but I believe that has been fixed in 2.0 (hasn't it?!)

Wildcard support prior to 2.0 was rather annoying, I think that was a generally
recognized failing of the older systems.  Wildcards, and command arguments 
were inconsistent between commands.  And each command had to contain it's own
wildcard code, which wasn't even available in a link library for use by 
programmers outside of Commodore.  However, in 2.0, things are much, much, much
better in terms of both wildcard support and consistency in the DOS commands.
And pattern matching is now a dos.library function call, which means that all
programmers have access to this, anywhere they want it.

>Ferry van het Groenewoud             \__/  groenewo@fwi.uva.nl  


-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
      "That's me in the corner, that's me in the spotlight" -R.E.M.

mstgil@sol (Marc Ph. A. J. St.-Gil) (05/04/91)

daveh@cbmvax.commodore.com (Dave Haynie) writes:

>In article <1991Apr25.100919.21595@fwi.uva.nl> groenewo@fwi.uva.nl (Ferry van het Groenewoud) writes:

>>MY problem with the #? wildcard is, that it are TWO characters, and, as everyone
>>figured out, a * is only ONE character. Add to this the unhandy place they are
>>at on the keyboard, makes the use of it at least twice as unhandy as using *.

>I never found it a problem myself, I suppose that's a matter of personal
>perference.  I do find the additional power of the Amiga wildcard language
>relative to that of other systems worth any extra effort involved.  Of course,
>I've been using this system since 1985.

>>Ferry van het Groenewoud             \__/  groenewo@fwi.uva.nl  
>Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"

NOTICE: Since I don't have a 2.0 system yet, this could all be irrelevant,
	so please hold off with the flamers.

I agree with you Dave, but wouldn't it be simple to go ahead and support the
* wildcard as well as the # and ? wildcards?  Since #? is functionally
equivalent to * (right?) what's the difficulty?  Doing so would satisfy
everyone, wouldn't it?  I would certainly be happy, because there are times
when I would like the power of # and ?, and then there are the lazy days
when a * will do just fine.
--
Marc St.-Gil, UNIX Systems Administrator   mstgil@{sol,vaxa,vaxb}.acs.unt.edu
 University of North Texas  817/565-2324   mstgil@{ponder,solo}.csci.unt.edu
 Academic Computing Services   DISCLAIMER: My employers had no idea I was
 PO Box 13495, Denton TX, 76203            going to say that.

andrewsr@steely.rutgers.edu (Rich Andrews) (05/04/91)

There is a PD program called starburst for AmigaDOS 2.0 which allows *
to be used.  Check your local BBS, or, if there is demand, I can
upload it to ab20.  (If it isn't already there).

-Rich
-- 
  // Rich    | "But maybe it's not too late...You can still cheat the hands
\X/  Andrews |  of fate...Just roll the dice and play the game... - Wendy O

jpc@fct.unl.pt (Jose Pina Coelho) (05/07/91)

In article <21179@cbmvax.commodore.com> daveh@cbmvax.commodore.com
(Dave Haynie) writes: 
>
>   Wildcard support prior to 2.0 was rather annoying, I think that was a generally
>   recognized failing of the older systems.  Wildcards, and command arguments 
>   were inconsistent between commands.  And each command had to contain it's own
>   wildcard code, which wasn't even available in a link library for use by 
>   programmers outside of Commodore.  However, in 2.0, things are much, much, much
>   better in terms of both wildcard support and consistency in the DOS commands.
>   And pattern matching is now a dos.library function call, which means that all
>   programmers have access to this, anywhere they want it.


 - Oh God!!!  Let it be UNIX-like wild cards (or full regexps).
 - .;,;,;.;,;,';'l[pl
 - ``No'' ?!?  What the hell do you mean with ``no'' ?
 - ":||"">|"
 - You mean ``#numeric'' to match a digit, and ``#AlPhAbEtIc'' to match
   mixed-case letters ?  You're SICK !!!
 
[ Lot's of smilleys for the humor impaired ]


We should at least have an inteligent (not stupid, at least) command
line parsing.

Copy files [to] [file/dir]
           ^^^^ why the f*** ?

By the way, what is the behavior of copy when I say "copy #? to" ?
Does it try directory ``to'' like it should ?


Confusedly yours,
--
Jose Pedro T. Pina Coelho   | BITNET/Internet: jpc@fct.unl.pt
Rua Jau N 1, 2 Dto          | UUCP: ...!mcsun!unl!jpc
1300 Lisboa, PORTUGAL       | Home phone: (+351) (1) 640767

- If all men were brothers, would you let one marry your sister ?

alex@bilver.uucp (Alex Matulich) (05/07/91)

In article <mstgil.673311266@sol> mstgil@sol.acs.unt.edu writes:
>I agree with you Dave, but wouldn't it be simple to go ahead and support the
>* wildcard as well as the # and ? wildcards?  Since #? is functionally
>equivalent to * (right?) what's the difficulty?  Doing so would satisfy
>everyone, wouldn't it?

That's why I use the ARP commands.  They give you the best of both worlds.
If ARP can reasonably support * (and in a consistent manner, yet), why
can't AmigaDOS?

-- 
 _ |__  Alex Matulich
 /(+__>  Unicorn Research Corp, 4621 N Landmark Dr, Orlando, FL 32817
//| \     UUCP:  alex@bilver.uucp   <or>  ...uunet!tarpit!bilver!alex
///__)     bitnet:  IN%"bilver!alex@uunet.uu.net"

sutela@polaris.utu.fi (Kari Sutela) (05/07/91)

jpc@fct.unl.pt (Jose Pina Coelho) writes:


>In article <21179@cbmvax.commodore.com> daveh@cbmvax.commodore.com
>(Dave Haynie) writes: 
>>
>>   And pattern matching is now a dos.library function call, which means that
>>   all programmers have access to this, anywhere they want it.

> - Oh God!!!  Let it be UNIX-like wild cards (or full regexps).

I don't understand why people consider the stupid star to be so important.
Anyway, there's a small PD-utility (StartBurst) which enables the DOS-flag
which makes * to be equal to #?.

To my knowledge the regexps supported in release 2 of system software are:
	?	matches any character
	#	matches an indefinite (0 or more) number of the following
		pattern
	|	matches either the pattern on the left or the right side
	()	used for grouping the patterns
	'	used to escape the following character
	%	a null pattern
	~	(tilde) matches anything but the following pattern
	[c-x]	matches a character range.  BTW, I didn't notice any
		documentation on this feature in my System Software
		manual --- anyone got a description of this?  It seems
		that one can also specify character sets like [cef].

As you can see, the 2.0 regexps are quite powerful.  They are not the same
as the Unix ones, but what's wrong with that.  AmigaDos is not Unix.

>Copy files [to] [file/dir]
>           ^^^^ why the f*** ?

Because one could want to specify the parameters in a different order.  For
example, "copy to destination from source".  Nevertheless, the TO and FROM
keywords are optional if one uses the normal order of the parameters (source
first/destination second).

>By the way, what is the behavior of copy when I say "copy #? to" ?
>Does it try directory ``to'' like it should ?

Don't know, haven't tried.  But really, should it???  You must escape Unixxy
options, too, if you want to use them as arguments (how do you grep for a
pattern like -i).  Have you tried 'copy #? "to"' --- notice the quotes around
the keyword?

-- 
Kari Sutela	sutela@polaris.utu.fi

peterk@cbmger.UUCP (Peter Kittel GERMANY) (05/07/91)

In article <JPC.91May6181646@terra.fct.unl.pt> jpc@fct.unl.pt (Jose Pina Coelho) writes:
>
>By the way, what is the behavior of copy when I say "copy #? to" ?
>Does it try directory ``to'' like it should ?

While you asked, I just tried it. The "to" is considered as a key
word by copy. So if you already have a dir named "to" where you want
your files to copy into, you write "copy #? to=to".

-- 
Best regards, Dr. Peter Kittel  // E-Mail to  \\  Only my personal opinions... 
Commodore Frankfurt, Germany  \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk

mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) (05/08/91)

In article <1991May7.003043.8751@bilver.uucp> alex@bilver.uucp (Alex Matulich) writes:
   That's why I use the ARP commands.  They give you the best of both worlds.
   If ARP can reasonably support * (and in a consistent manner, yet), why
   can't AmigaDOS?

ARP can't reasonably support "*". It can only try, and fail. You see,
AmigaDOS uses "*" to mean "the window the is typing in". The third
time I typed "copy * filename" to cram text into a file, and then had
to watch the ARP copy move every file in my current directory into
filename, I deinstalled arp.

In article <1991May7.003043.8751@bilver.uucp> alex@bilver.uucp (Alex Matulich) writes:

   >Copy files [to] [file/dir]
   >           ^^^^ why the f*** ?

   Because one could want to specify the parameters in a different order.  For
   example, "copy to destination from source".

For utilities that generate command lines, this is what makes the
multi-source-file version copy work reasonably.

For instance, on unix, to move all the .c files out of a directory
requires exec'ing one cp per file, even though cp takes multiple
arguments. You do:

	find . -name '*.c' -exec cp '{}' dest \;

If Unix had an AmigaDOS 2.0 copy, you could do it with a single
invocation of copy as:

	find . -name '*.c' -print | xargs copy to dest

If you don't have (or don't like) the unix tools, you can get treewalk
and do (starburst on):

	treewalk filter "name == '*.c'" copy to dest

with the same result.

	<mike

--
That time we slept together				Mike Meyer
That's as far as it went				mwm@pa.dec.com
Yet though we're not quite lovers			decwrl!mwm
You're more than a friend

asg@sage.cc.purdue.edu (The Grand Master) (05/08/91)

In article <MWM.91May7110230@raven.pa.dec.com> mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) writes:
}
}ARP can't reasonably support "*". It can only try, and fail. You see,
}AmigaDOS uses "*" to mean "the window the is typing in". The third
}time I typed "copy * filename" to cram text into a file, and then had
}to watch the ARP copy move every file in my current directory into
}filename, I deinstalled arp.
So then ARP is reasonably supporting * as it is used in most other major
OS's, to mean match any pattern. 
}
}   >Copy files [to] [file/dir]
}   >           ^^^^ why the f*** ?
}
}   example, "copy to destination from source".
}
}For utilities that generate command lines, this is what makes the
}multi-source-file version copy work reasonably.
}
}For instance, on unix, to move all the .c files out of a directory
}requires exec'ing one cp per file, even though cp takes multiple
}arguments. You do:
}
}	find . -name '*.c' -exec cp '{}' dest \;
}
Someone has missinformed you about this:
My man page says:
Usage: cp [-ip] f1 f2; or: cp [-irp] f1 ... fn d2
which means you can do
cp ` find . -name '*.c' -print` dest


The basic wildcard notation of UNIX is pretty standard among
some other popular OS's. DOS and VMS treat * the same way as
does UNIX. It is not unreasonable to ask Amiga to do the same.
Bruce
}	<mike
}--
}That time we slept together				Mike Meyer
}That's as far as it went				mwm@pa.dec.com
}Yet though we're not quite lovers			decwrl!mwm
}You're more than a friend
 ^^^^^^^^^^^^^^^^^^^^^^^^^
(that is underlineing the whole passage, not just the last line)
You obviously do not understand what sex is all about

---------
                                   ###             ##
Courtesy of Bruce Varney           ###               #
aka -> The Grand Master                               #
asg@sage.cc.purdue.edu             ###    #####       #
PUCC                               ###                #
;-)                                 #                #
;'>                                #               ##

GIAMPAL@auvm.auvm.edu (05/08/91)

In article <MWM.91May7110230@raven.pa.dec.com>, mwm@pa.dec.com (Mike (My Watch
Has Windows) Meyer) says:
>For instance, on unix, to move all the .c files out of a directory
>requires exec'ing one cp per file, even though cp takes multiple
>arguments. You do:
>
>        find . -name '*.c' -exec cp '{}' dest \;
>
Mike, I don't think that's the case in Unix (at least not under Csh on
SunOS greater than 3.5).  I normally do :

         mv *.c /tmp

And that works just fine.  Of course if I want to move directories I
have to do them separately, but there's no need to use find to just
move a couple of files to another directory.

--dominic

jpc@fct.unl.pt (Jose Pina Coelho) (05/08/91)

In article <MWM.91May7110230@raven.pa.dec.com> mwm@pa.dec.com (Mike
(My Watch Has Windows) Meyer) writes: 
>
>      >Copy files [to] [file/dir]
>      >           ^^^^ why the f*** ?
>
>      Because one could want to specify the parameters in a different order.  For
>      example, "copy to destination from source".
>
>   For utilities that generate command lines, this is what makes the
>   multi-source-file version copy work reasonably.

For those utilities, in unix, you find a powerfull mix of awk, sed,
find & perl, on the other hand, in UNIX, it's the shell that is in
charge of expanding the wild names, leaving the programs with an easy
interface and simple works.

when you do 'ls *.c' the shell will build a list of the files that
match the expression, and will call ls with those arguments.  Only if
there are no matches, will ls get *.c, which it will try to copy, and
fial with 'cp: *.c: No such file or directory'

>   For instance, on unix, to move all the .c files out of a directory
>   requires exec'ing one cp per file, even though cp takes multiple
>   arguments. You do:
>
>	   find . -name '*.c' -exec cp '{}' dest \;

That finds all files that match a pattern in a directory tree (bellow
us) and execs copy for each file that does, that's slow, you have
quite better options:

 find . -type d -print | awk '{ printf "cp %s/*.c dest\n", $0 }' | sh

this will: Find all dirs, Create a command line to copy from each dir,
pass them, to the shell for wildcard expansion and execution.

 for i in `find . -type d -print`
 do
	cp $i/*.c dest
 done

>
>   If Unix had an AmigaDOS 2.0 copy, you could do it with a single
>   invocation of copy as:
>
>	   find . -name '*.c' -print | xargs copy to dest

You can do that as:
	cp `find . -name '*.c' -print` dest
or (depends on your shell flavour)
	cp $(find . -name '*.c' -print) dest


What I was barfing at was mostly the [to], it has no business there.
If I want to copy something then I must tell WHERE to, and it can be
only one thing, the last one (or the first one, though 

jpc@fct.unl.pt (Jose Pina Coelho) (05/08/91)

In article <sutela.673598529@polaris> sutela@polaris.utu.fi (Kari
Sutela) writes: 
   jpc@fct.unl.pt (Jose Pina Coelho) writes:
   >In article <21179@cbmvax.commodore.com> daveh@cbmvax.commodore.com
   >(Dave Haynie) writes: 
   >>
   >>   And pattern matching is now a dos.library function call, which means that
   >>   all programmers have access to this, anywhere they want it.

   > - Oh God!!!  Let it be UNIX-like wild cards (or full regexps).

>   I don't understand why people consider the stupid star to be so important.
>   Anyway, there's a small PD-utility (StartBurst) which enables the DOS-flag
>   which makes * to be equal to #?.
Because, it has been used with that semantics for too long, half of
the people that use command line, be it MSDOS, Unix, Vms etc ... are
almost hard-wired to recognize * as zero or more characters.

>   To my knowledge the regexps supported in release 2 of system software are:
>	   ?	matches any character
>	   #	matches an indefinite (0 or more) number of the following
>		   pattern
>	   |	matches either the pattern on the left or the right side
>	   ()	used for grouping the patterns
>	   '	used to escape the following character
>	   %	a null pattern
>	   ~	(tilde) matches anything but the following pattern
>	   [c-x]	matches a character range.  BTW, I didn't notice any
>		   documentation on this feature in my System Software
>		   manual --- anyone got a description of this?  It seems
>		   that one can also specify character sets like [cef].
So, they want something that is more regexp alike ?, why create
something that resembles the true regexp, and yet paint it as
something diferent ?

RegExp's as they have been for the past 15 years:
	. - Match any character
	* - Zero or more times the previous pattern. 
	+ - One or more times the previous pattern.
	? - Zero or one time the previous pattern.
	() - Group pattern
	| - Either the pattern on the left or the right side
	^ - Start of string
	$ - end of string
	[chars] - Match chars.
	[^chars] - Match anything but chars.
	      - If you have char1-char2, that means anything between
                char1 and char2.
              - To match a '-' use it as the first character.
        \ - escape the following character. 
	{n,m} - n or m times the previous pattern. (Not sure if it's standard)

>   As you can see, the 2.0 regexps are quite powerful.  They are not the same
>   as the Unix ones, but what's wrong with that.  AmigaDos is not Unix.
As we can see, the oldtime, unix regexps are more powerfull, and have
the following advantages:
  - It's already done.
  - Lot's of public-domain/freeware/otherwares implementations, so C=
    could have just taken one and put it in the ROM (ort the shell, or
    the programs, or a library).  They could even implement one (not
    that hard).
  - It's standard (Maybe a standard that never got to ANSI (or maybe
    it did), but anyway a standard.


>   >Copy files [to] [file/dir]
>   >           ^^^^ why the f*** ?
>
>   Because one could want to specify the parameters in a different order.  For
>

daveh@cbmvax.commodore.com (Dave Haynie) (05/09/91)

In article <1991May7.003043.8751@bilver.uucp> alex@bilver.uucp (Alex Matulich) writes:
>In article <mstgil.673311266@sol> mstgil@sol.acs.unt.edu writes:
>>I agree with you Dave, but wouldn't it be simple to go ahead and support the
>>* wildcard as well as the # and ? wildcards?  Since #? is functionally
>>equivalent to * (right?) what's the difficulty?  Doing so would satisfy
>>everyone, wouldn't it?

>That's why I use the ARP commands.  They give you the best of both worlds.
>If ARP can reasonably support * (and in a consistent manner, yet), why
>can't AmigaDOS?

Maybe because * is already taken.  What does ARP do with:

	copy * quick_file

If it doesn't let me type from the console into a file called "quick_file",
then its doing the wrong thing.  The "* kludge" feature of 2.0 handles the use
of * intelligently, at least; the above example works correctly, but * can be
used as shorthand for #? as long as other characters go with it.  Personally,
I have no use for the "* kludge" feature, but others can switch it on when
using 2.0 if they like.

-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
      "That's me in the corner, that's me in the spotlight" -R.E.M.

daveh@cbmvax.commodore.com (Dave Haynie) (05/09/91)

In article <12024@mentor.cc.purdue.edu> asg@sage.cc.purdue.edu (The Grand Master) writes:

>The basic wildcard notation of UNIX is pretty standard among
>some other popular OS's. DOS and VMS treat * the same way as
>does UNIX. It is not unreasonable to ask Amiga to do the same.

Actually, that's not true, the meaning of * is slightly different in UNIX,
MS-DOS, and VMS.  For example, if I type "rm *" in a directory under UNIX,
all files get deleted.  In MS-DOS, only files not ending in ".???" get 
deleted.  In VMS, it's an error, since you can't partially specify files to
delete.  At other times in VMS, "abcd*", for example, actually means
"abcd*.LST;n", where "n" is the most current version of said file.  Under
Apollo's Domain/OS, * can't be used alone, it means the same thing as # in
AmigaOS, only it's a postfix rather than prefix operator.

So I agree with the use of # in AmigaOS.  A die-hard MS-DOS user would get
a few syntax errors with Delete, but never accidently delete all files when
the intention was to delete the files not ending in ".???".  A UNIX user
shouldn't care, because these folks are smart enough to adapt to the OS that
they're using; after all, once you've dealt with the most cryptic OS, anything
else should be a cakewalk.

>Courtesy of Bruce Varney           ###               #
-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
      "That's me in the corner, that's me in the spotlight" -R.E.M.

mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) (05/09/91)

In article <12024@mentor.cc.purdue.edu> asg@sage.cc.purdue.edu (The Grand Master) writes:
   }For instance, on unix, to move all the .c files out of a directory
   }requires exec'ing one cp per file, even though cp takes multiple
   }arguments. You do:
   }
   }	find . -name '*.c' -exec cp '{}' dest \;
   }
   Someone has missinformed you about this:
   My man page says:
   Usage: cp [-ip] f1 f2; or: cp [-irp] f1 ... fn d2
   which means you can do
   cp ` find . -name '*.c' -print` dest

Sorry, your version breaks if you generate to long a command line
(before running out of memory, that is). While that number has gone up
with more recent versions of unix, Plan 9 (which may or may not be
considered a "version of Unix") is the only one I know of that avoids
it completely. Note that "long lines" is typically 5K or more; it's
20K on the box I'm using now. Both treewalk and xargs avoid this
problem.

   }That time we slept together				Mike Meyer
   }That's as far as it went				mwm@pa.dec.com
   }Yet though we're not quite lovers			decwrl!mwm
   }You're more than a friend
    ^^^^^^^^^^^^^^^^^^^^^^^^^
   (that is underlineing the whole passage, not just the last line)
   You obviously do not understand what sex is all about

Wrong forum, but I expect your understanding of sex is even worse than
your understanding of Unix.

	<mike
--
And then up spoke his own dear wife,			Mike Meyer
Never heard to speak so free.				mwm@pa.dec.com
"I'd rather a kiss from dead Matty's lips,		decwrl!mwm
Than you or your finery."

daveh@cbmvax.commodore.com (Dave Haynie) (05/10/91)

In article <JPC.91May8164738@terra.fct.unl.pt> jpc@fct.unl.pt (Jose Pina Coelho) writes:

>Because, it has been used with that semantics for too long, half of
>the people that use command line, be it MSDOS, Unix, Vms etc ... are
>almost hard-wired to recognize * as zero or more characters.

> [UNIX regexps, which aren't used for file name matching]
>	* - Zero or more times the previous pattern. 

Notice the contradiction?  UNIX has never had a reputation for self-consistency
and this is a good example.  AmigaDOS uses a decent regular expression language
for file name globbing, and as of 2.0, makes it a DOS function call than can be
used anywhere.  

>  - It's standard (Maybe a standard that never got to ANSI (or maybe
>    it did), but anyway a standard.

The great thing about standards, there are so many of them.  One operating
system really doesn't need two "standards" for the same thing, much less more
than that.  And I can guarantee you, if we had made the Amiga's general
regular expression matching function equivalent to the UNIX regexp stuff, we
would have far more complaints than we do now (the "." being a regexp 
metacharacter alone would cause chaos the way files are typically named on
computers these days).  If we had made it the same as the UNIX file name 
globbing language, we would have a much less powerful means of expression.

So, the Amiga has its standard.  Try it some time, it works good.

-- 
Dave Haynie Commodore-Amiga (Amiga 3000) "The Crew That Never Rests"
   {uunet|pyramid|rutgers}!cbmvax!daveh      PLINK: hazy     BIX: hazy
      "That's me in the corner, that's me in the spotlight" -R.E.M.

aduncan@rhea.trl.OZ.AU (Allan Duncan) (05/10/91)

From article <21405@cbmvax.commodore.com>, by daveh@cbmvax.commodore.com (Dave Haynie):
...
>>If ARP can reasonably support * (and in a consistent manner, yet), why
>>can't AmigaDOS?
> 
> Maybe because * is already taken.  What does ARP do with:
> 
> 	copy * quick_file
> 
> If it doesn't let me type from the console into a file called "quick_file",
> then its doing the wrong thing.  The "* kludge" feature of 2.0 handles the use
> of * intelligently, at least; the above example works correctly, but * can be
> used as shorthand for #? as long as other characters go with it.  Personally,
> I have no use for the "* kludge" feature, but others can switch it on when
> using 2.0 if they like.

No, Dave, the use of * to represent the console is the kludge.  There
are many way this could have been done instead of using an already
overloaded single character symbol.  ARP's solution to this particular
usage is elegant although not obvious -
	type >quickfile
Shades of pipes, eh?

Allan Duncan	ACSnet	 a.duncan@trl.oz
(+613) 541 6708	Internet a.duncan@trl.oz.au
		UUCP	 {uunet,hplabs,ukc}!munnari!trl.oz.au!a.duncan
Telecom Research Labs, PO Box 249, Clayton, Victoria, 3168, Australia.

harris@garfield.catt.ncsu.edu (Michael Harris) (05/10/91)

jpc@fct.unl.pt (Jose Pina Coelho) writes:

>>   I don't understand why people consider the stupid star to be so important.

Because it is one less character to type.  People tend to be lazy you know.
 __   _ ___ ___   Michael Harris - harris@catt.ncsu.edu      //        _    
|    / \  | |    Computer and Technologies Theme Program    // /||\/||/ _ /|
|__ / /_\ | |        North Carolina State University      \X/ /-||  ||\_|/-|
                                  

FelineGrace@cup.portal.com (Dana B Bourgeois) (05/11/91)

Zounds!  We can add CLI wildcards to the list of Subjects-That-You-
Don't-Discuss-At-The Dinner-Table.  Here's a list of guaranteed
Flame-starting subjects:

You like <name-of-editor>?  Why?  It's so totally Brain-Dead!
'<ASCII character>' is a stupid choice for a wild-card!
Wildcard expansion belongs in the <program/shell/other - choose 1>
<name of OS> is lousy!  <different OS name> is much better!

and last but not least is that old favorite:

Less filling / Tastes Great!

Dana Bourgeois @ cup.portal.com

uzun@pnet01.cts.com (Roger Uzun) (05/11/91)

[]
What is the "* kludge" feature of AmigaDOS 2.0? And how can I activate it.
I want to use * as a wildcard, not as a console id.

-Roger

I want * == #?


UUCP: {hplabs!hp-sdd ucsd nosc}!crash!pnet01!uzun
ARPA: crash!pnet01!uzun@nosc.mil
INET: uzun@pnet01.cts.com

bleys@tronsbox.xei.com (Bill Cavanaugh) (05/11/91)

In article <1991May10.140618.12121@ncsu.edu> harris@garfield.catt.ncsu.edu (Michael Harris) writes:
>jpc@fct.unl.pt (Jose Pina Coelho) writes:
>
>>>   I don't understand why people consider the stupid star to be so important.
>
>Because it is one less character to type.  People tend to be lazy you know.

I've got a better reason than just that it's one extra character.
Think of us touch typists (yeah, there are techie's who know how to do
that!<grin>) who have to hit shift with the right little finger and
reach up to the three with the left middle finger for #, then have to
reach down and hit shift with the left little finger and hit the / key
with the right little finger for ?.  Now do you see why hitting shift-8
for * is so much easier?

Of course, I'm also a lazy person...<chuckle>

-- 
 *         Bill Cavanaugh       bleys@tronsbox.xei.com          *
 *                                                              *
 *       Who woulda thought that by staying in one place        *
 *                 I'd become a refugee?                        *
 *                                                              *
 *                             Doug and the Slugs               *

barrett@jhunix.HCF.JHU.EDU (Dan Barrett) (05/13/91)

In article <1623@tronsbox.xei.com> bleys@tronsbox.xei.com (Bill Cavanaugh) writes:
>[Ease of typing * vs. #?...]
>Think of us touch typists who have to hit shift with the right little
>finger and reach up to the three with the left middle finger for #, then
>have to reach down and hit shift with the left little finger and hit the /
>key with the right little finger for ?.  Now do you see why hitting shift-8
>for * is so much easier?

	No, and I'm a touch-typist too. :-) Hold down the right SHIFT key
with your little finger.  Press the '#' key, and then STILL HOLDING THE
SHIFT KEY tap the '?' with your fourth finger.  Lightning fast.  (And I'm
a long-time UNIX '*' person too.)

	Followups to misc.typing.hints. :-)

                                                        Dan

 //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
| Dan Barrett, Department of Computer Science      Johns Hopkins University |
| INTERNET:   barrett@cs.jhu.edu           |                                |
| COMPUSERVE: >internet:barrett@cs.jhu.edu | UUCP:   barrett@jhunix.UUCP    |
 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////

FelineGrace@cup.portal.com (Dana B Bourgeois) (05/13/91)

I know somebody out there will Flame me for this but aside from issues
such as 'its the standard' or 'Unix does it' or 'less characters - looks
great', the reason *I* like the '*' wildcard is because (right or wrong,
guys) MS-DOS uses it.  And MS-DOS only has two friggin wild card characters
so I use 'em ALOT at work.  My fingers just WANT to type 'dir *' when I
feel a need to see all my files in the current directory.  Pavlov et. al.
I guess.  Much as it pains me to say it, I spend more time on my @##&!!
PC at work than I do on my Amy at home - but my time at home is QUALITY
time.  Amy isn't jealous.  Still, I am much happier having only one set
of typing reflexes.  I rarely use '#?' and only got bit once when I 
tried to do some operation using a Fish program that echoed current output
to the screen instead of acting on every file in the current directory.  
It's been so long, I don't remember the program or what I was trying to
do.  I'm happy with ARP but I guess I am in the minority.  I always
wanted to be special, and now I am!!

Dana Bourgeois @ cup.portal.com

pilgrim@daimi.aau.dk (Jakob G}rdsted) (05/13/91)

It's just this simple:On unix machines, i constantly type dir and gets a 
?command not found.(I DON'T want alis dir ls )
On my amiga, i typed ls -l and used to get errors. (I use csh and ls4.1jr now)
The only real problem is these reflexes, the previous poster mentioned. It
takes an effort to adjust between different machines, and this is most of
the reason I now can use * and type ls -l at home. So I don't think * is
better or worse than #?. What is worse is to type the wrond command and press
return.
--
From the notorious
                      Jakob Gaardsted, Computer Science Department
Bed og arbejd !            University of Aarhus,  Jylland (!)
(Pray and work!)  AMIGA!  pilgrim@daimi.aau.dk | I'd rather play Moria.

taak9@isuvax.iastate.edu (Steve Sheldon) (05/14/91)

In article <42279@cup.portal.com>, FelineGrace@cup.portal.com (Dana B Bourgeois) writes:
>I know somebody out there will Flame me for this but aside from issues
>such as 'its the standard' or 'Unix does it' or 'less characters - looks
>great', the reason *I* like the '*' wildcard is because (right or wrong,
>guys) MS-DOS uses it.  And MS-DOS only has two friggin wild card characters

  Umm, I would just like to say that CP/M used the same wildcards,
and it was around before MS-DOS.  It's just kind of an unwritten standard.

>
>Dana Bourgeois @ cup.portal.com

TAAK9@ccvax.iastate.edu

jap@convex.cl.msu.edu (Joe Porkka) (05/15/91)

FelineGrace@cup.portal.com (Dana B Bourgeois) writes:

>I know somebody out there will Flame me for this but aside from issues
>such as 'its the standard' or 'Unix does it' or 'less characters - looks
>great', the reason *I* like the '*' wildcard is because (right or wrong,
>guys) MS-DOS uses it.  And MS-DOS only has two friggin wild card characters


You could use the same argument for the amy to use the \ instead of /
and to allow . and ..

I'm not going to say one is better or one is worse - they are just different.

Under ADos 2.0 you *can* have '*' work, sortof.

MSDOS's '*' is broken - for example "a*x.yuk" is exactaly equivalent
to "a*.yuk" - MSDOS ignores stuff to the right of the *