>I've lived with it for quite a while (as well as worked around it), but I'm
>still curious -- why did CBM make the standard Amiga wildcard #? ? It seems
>foolish to type two characters, when a single character wildcard (*) was/is
>the standard wildcard for most other major systems (including the PC world,
>UNIX, and VMS).
AFAIK, the "#?" wildcard is actually 2 wildcards - "?" matching any
character (taking the place of the unix "." regexp character) and the
preceding "#" meaning 0 or more instances of the following regexp, which is
the equivalent of the UNIX "*" regexp character. "#?" is actually the UNIX
equivalent of ".*", both match any string of characters. This is actually
more consistent pattern matching than UNIX, where most shells use a different
pattern matching scheme on their command lines than that used by regexp(5),
the regular expression matching library.
IMO it would have been a nice idea to have implemented the regexp standard
from the start, for all Amiga pattern matching including command lines. I'm
always typing regular expressions from the wrong context :-/. UNIX-like
regexp matching is supported in a third party library (PD or shareware - I
don't remember now) but only a few programs support it.
Of course if you really wanted UNIX-like regexps, you could always download
Amiga Csh or some other shell port! :)
>-- These are my opinions only --
>Omar Siddique | CS major - University of Maryland, Baltimore County campus
> | email: osi...@umbc.edu WWW: http://umbc8.umbc.edu/~osiddi1
>"When you pass the buck, don't ask for change. -- Solomon Short"
--
========================= Generating: .signature
Richard Ling Clipping: complete
g914...@cs.uow.edu.au Colour analysis: complete
========================= Rendering: 37.6%
The pattern "#?" is more powerful than "*". The "#" means "match
any number of the following", and the "?" means any character; thus,
"#?" literally means "match any number of any character." But you can
use the "#" in different ways that are impossible with "*". For
instance, the pattern "#a" matches "a", "aa", "aaa", "aaaa", etc., but
NOT "abc". There is no equivalent to "#a" using an asterisk.
All of this begs the question of whether "#" is actually USEFUL when
used without the "?". In my experience, the answer is no. In 7+ years of
Amiga use, I've almost never used "#" without the "?" for anything practical.
In AmigaDOS 2.0, CBM made the "*" equivalent to "#?" (provided
you set a flag in the operating system, and many Commodities like Yak
let you do this), presumably in response to user requests.
Dan
//////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
| Dan Barrett -- Computer Science Dept, University of MA, Amherst, MA 01003 |
| http://zoo.cs.umass.edu/~barrett/public.html -- bar...@cs.umass.edu |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////
One more thing -- despite what you say, "*" is NOT a standard
wildcard for the PC world, UNIX, and VMS. It actually means something
different on all three machines.
For MS-DOS, it means "match all characters except for the period."
That's why you have to type the period for expressions like "*.*". As on
the Amiga, wildcards are understood by some programs but not all. (At least
this was true the last time I used MS-DOS.)
For UNIX, it means "match all characters, except for a LEADING
period." So the expression "*oo" will match "foo" and "me.too", but it
won't match ".wahoo". Wildcards work for both file and directory names.
Since they are handled by the shell, not the operating system, wildcards
"work" for all programs executed at the command line.
For VMS, it works for filenames but NOT for directory names (dumb
dumb dumb), and its interactions with the period and the semicolon (version
number indicator) are something I don't remember.
So it is a myth that "*" means the same thing for MS-DOS, UNIX,
and VMS.
-- These are my opinions only --
Omar Siddique | CS major - University of Maryland, Baltimore County campus
| email: osi...@umbc.edu WWW: http://umbc8.umbc.edu/~osiddi1
"Theatre is life. Film is art. Television is furniture."
You mean "all three operating systems", right ?...
>
> [ stuff about MS-DOS & UNIX deleted ]
>
> For VMS, it works for filenames but NOT for directory names (dumb
> dumb dumb), and its interactions with the period and the semicolon (version
> number indicator) are something I don't remember.
>
If this is VAX/Open VMS or AXP/Open VMS you are referring to, then I would
like to correct you on this one. In VMS the "*" matches any length of any
characters and it can be used for the directory, filename, filetype and
file version elements of a file specification. "%" is used to match any
single character.
> So it is a myth that "*" means the same thing for MS-DOS, UNIX,
> and VMS.
Agreed...
>
> Dan
>
> //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
> | Dan Barrett -- Computer Science Dept, University of MA, Amherst, MA 01003 |
> | http://zoo.cs.umass.edu/~barrett/public.html -- bar...@cs.umass.edu |
> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////
Regards,
David Chan Sho Ving
It is a little more complicated than that. MS-DOG only uses trailing asterisks
"correctly." Once it sees a * it ignores the rest of the pattern. So
*foo.*
matches _any_ name.
Ron
--
A just machine to make big decisions | Ron Charlton
Programmed by fellows with compassion and vision | char...@cs.utk.edu
We'll be clean when their work is done ----------------------
We'll be eternally free yes and eternally young -- Donald Fagen, I.G.Y.
> The pattern "#?" is more powerful than "*". The "#" means "match
>any number of the following", and the "?" means any character; thus,
>"#?" literally means "match any number of any character." But you can
>use the "#" in different ways that are impossible with "*". For
>instance, the pattern "#a" matches "a", "aa", "aaa", "aaaa", etc., but
>NOT "abc". There is no equivalent to "#a" using an asterisk.
So then, is there a command that'll EXCLUDE certain files? For example,
say I have a bunch of gifs and jpegs and iffs in my directory. Since the
iffs don't have extentions, how can I compress them, without compressing
the jpegs and the gifs?
The pattern ~(#?.gif|#?.jpg) should do the trick - assuming that the
gifs end in .gif and the jpegs in .jpg. ( "~" means 'not')
o
Hakon Enger
haa...@ifi.uio.no
[ New .sig coming soon! ]
[...]
So then, is there a command that'll EXCLUDE certain files? For example,
say I have a bunch of gifs and jpegs and iffs in my directory. Since the
iffs don't have extentions, how can I compress them, without compressing
the jpegs and the gifs?
The tilde (~) is used for not, and the pipe (|) is used for or (as far
as I can remember), so what you need to do is compress NOT(*.gif OR
*.jpg), but I can't remember the syntax (you need some kind of
brackets in there too). It's definitely possible, though; I have done
it.
--
// Eyvind Bernhardsen -- finger -l for PGP key -- eyv...@pvv.unit.no
\X/ "MS Word is an ugly, clanking, God-awful mess of a program." -DNA
True, in normal use, which can be understood as file name matching,
the power of #? is pretty much wasted. However, it CAN be
useful. Think of all the places in the UNIX world where regexps are
used. How many of these could be done with simple * and ? matching?
Unfortunately, regexps are extremely unwieldy and hard to learn, not
to mention that a complicated match will be next to incomprehensible
without looking at it for 10 minutes.
AmigaDOS pattern matching is as powerful as regexps are, it is
standard (which means it is used in the shells too. Guess WHY UNIX
shells don't use regexps for filename matching? ;)), and it is a lot
easier to learn and use. I think it's great to have such a tool. File
content searches using C:Search are a lot easier than with egrep.. ;)
> In AmigaDOS 2.0, CBM made the "*" equivalent to "#?" (provided
>you set a flag in the operating system, and many Commodities like Yak
>let you do this), presumably in response to user requests.
Unfortunately, the place where this would be most useful, ie. matching
everything (* takes less than half the time to type compared to #?, at
least on Finnish keyboards), doesn't work, because shell interprets
that as a reference to the console... :( Using * for an escape
character has to be one of the worst decisions that were made in
designing AmigaDOS 1.0.
--
<A HREF="http://www.hut.fi/~oahvenla/">My home page</A>
In article <OSMA.AHVENLAMP...@lk-hp-9.hut.fi>,
Osma Ahvenlampi <Osma.Ah...@hut.fi> wrote:
>True, in normal use, which can be understood as file name matching,
>the power of #? is pretty much wasted. However, it CAN be
>useful. Think of all the places in the UNIX world where regexps are used....
[Explanation of wy regular expressions are good things.]
Yes, regular expressions are definitely useful and important. I was
just saying that I have rarely needed to use "#" without "?" when matching
filenames... so was this syntax a good idea for filename wildcarding? I
don't know.
Well, there _is_ a workaround, but if it takes too long to type '#?', you
won't like it.... 8^)
The solution is, escape the '*' with another '*' (i.e. type '**') when using
it alone. Voila, instant 'copy ** to ram:'. In fact, it always works--try
'copy foo:bar/** to ram:'.
Another little slightly-but-not-intuitively-obvious AmigaDOS feature.
--
Peter Edward Janes // | "I always wondered how Tom Waits would
(pej...@descartes.uwaterloo.ca)// | sing Greensleeves...."
Certified Amiga Developer \X/ | --Loreena McKennitt, _The Visit_
** SUPPORT CANADIAN MUSIC ** | (liner notes for Greensleeves)
Yes, there is. Try compress ~(#?.(jpegs|gifs)).
----------------------------------------------------------------------------
Richard Deken Graduate student in electrical engineering
PGP public key available Tennessee Technological University
Internet: rad...@gemini.tntech.edu Cookeville, TN, USA
} In article <31hhra$d...@borg.cs.umass.edu> bar...@cs.umass.edu (Daniel Barrett) writes:
} > All of this begs the question of whether "#" is actually USEFUL when
} >used without the "?". In my experience, the answer is no. In 7+ years of
} >Amiga use, I've almost never used "#" without the "?" for anything practical.
}
} True, in normal use, which can be understood as file name matching,
} the power of #? is pretty much wasted. However, it CAN be
} useful. Think of all the places in the UNIX world where regexps are
} used. How many of these could be done with simple * and ? matching?
} Unfortunately, regexps are extremely unwieldy and hard to learn, not
} to mention that a complicated match will be next to incomprehensible
} without looking at it for 10 minutes.
Now wait a second here. A major reason why regexps in
Unix are hard to learn is because they are not supported by the OS,
and so _every_ damn program you run into implements some different
flavor of regexp. If sed, and awk, and grep and egrep and ... [not
to mention filename wildcards] all used the same regexp machinery,
it'd be a fairly straightforward single bit of stuff to learn and
you'd then have it all at once.
And as for complicated, for sure that is correct in the limit. It
is certainly _possible_ to cobble up near-unfathomable regexps.
BUT: note that folks trained on Unix [and so accustomed to use only
simpleminded wildcard expressions in file names] ONLY complain
about the #? <--> * as a matter of typing inconvenience, No one
I've ever heard, in the years and years and years that this topic
has popped up here on the newsgroup from time to time, has ever
complained that the AmigaDOS wildcards were _too_complicated_.
Using regexps for complicated things will be complicated...fine.
But using regexps for simple things won't necessarily be
particularly more complicated that using some different, more
limited, matching facility.
} ... (which means it is used in the shells too. Guess WHY UNIX
} shells don't use regexps for filename matching? ;)),
Actually, this is a very tricky question and dates back to the
pre-6th edition days of Unix [when wildcards were still expanded
by explicitly calling the "glob" program].
/Bernie\
--
Bernie Cosell ber...@fantasyfarm.com
Fantasy Farm Fibers, Pearisburg, VA (703) 921-2358
DB> From: bar...@cs.umass.edu (Daniel Barrett)
DB> So it is a myth that "*" means the same thing for MS-DOS, UNIX, and
DB> VMS.
but you can also use ** in amiga dos without setting the flag, and it will
funktion the same way as #? do.
One standard, even if not the best possible, is better than several
competing standards. Thus it is a Good Thing(tm) to have AmigaDOS use
the same pattern matching everywhere. IMO.
Now I beat myself for not thinking of this ;)
** is still a lot faster than to dig #? from under shift-3
shift-+.. And if I didn't have a customised keymap, that would be
alt-shift-3 shift-+... And what's more, ** works on UNIX too ;)
>Another little slightly-but-not-intuitively-obvious AmigaDOS feature.
You can say that again ;) Thanks a lot!
(and I was thinking that maybe reading comp.sys.amiga.misc is a waste
of time...)
> but you can also use ** in amiga dos without setting the flag, and it will
> funktion the same way as #? do.
What is this flag and how/where do I set it?
I only have an Amiga 1200 with unofficial harddisk, so I don't have the DOS
manual.
--
/// ------------------------------------------------------------ \\\
/// Janne T. Siren I Epsilon Indi BBS (*) +358-0-505-4201 \\\
\\\/// j...@krk.fi I Located in Kauniainen, Finland, Europe \\\///
\XX/ ------------------------------------------------------------------ \XX/
list >ram:do ~(#?.(gif|jpg)) lformat "compress -b 16 -v %s"
execute ram:do
/===========================================================\
| Scott Maxwell - sco...@cup.portal.com |
| Amiga 1000, 2000, 1200, Atari 800, 800XL, 1200XL, 130XE, |
| Pet, SuperPET, Vic, 64, +4, 128D, TI, //e, //c+, Nixdorf |
| I have WAY too many computers! |
\===========================================================/
Pardon? This is news to me. I just tested it with DIR, and it tried to
treat the ** as part of the filename. Doesn't work here. Do you use
a different shell perhaps?
--
Best regards, Dr. Peter Kittel // E-Mail to \\ Only my personal opinions...
Commodore Frankfurt, Germany \X/ (pet...@cbmger.de.so.commodore.com)
peterk%cbmger.de.so....@cbmnl.cbm.nl
peterk%cbmger.de.so....@cbmvie.co.at
: > but you can also use ** in amiga dos without setting the flag, and it will
: > funktion the same way as #? do.
: What is this flag and how/where do I set it?
If an * is part of a pathname, it is treated as "#?"
e.g. Copy RAM:* DF0: == Copy RAM:#? DF0:
If an * is all by itself, it is treated as a console.
e.g. Copy * PRT: == Copy CON: PRT:
: I only have an Amiga 1200 with unofficial harddisk, so I don't have the DOS
: manual.
--
// | "NEVER EVER mess with a PCB jumper you don't
// Maxwell Daymon | understand, even if it's labelled 'SEX AND
\\ // mda...@rmii.com | FREE BEER'."
\X/ | -- Dave Haynie
: list >ram:do ~(#?.(gif|jpg)) lformat "compress -b 16 -v %s"
: execute ram:do
or even better (IMHO)
run execute PIPE:compress
list ~(#?.(gif|jpg)) lformat "compress -b 16 -v %s" TO PIPE:compress
as this gives you your prompt back right away.
Actually, as long as the * is not by itself, you can use a single *
i.e. "copy ram:temp/* dh0:stuff" will work.
You only need to use ** if it is standing by itself.
> Jonas Karlsson (jonas.k...@cyber.ct.se) wrote:
> > In a message of 01 Aug 94 Daniel Barrett wrote to All:
>
> > but you can also use ** in amiga dos without setting the flag, and it
> will
> > funktion the same way as #? do.
>
> What is this flag and how/where do I set it?
You need a program to toggle this flag in DOSBase like SetStar.
It is so small, I dare posting it here.
begin 777 SetStar.lha
M'6LM;&@U+2H! !< 0 P6)N&Q !U-E=%-T87+M"@$"8F.QM6$^^U$NIH3 X
MT:G';"ENMUJAA_"V<M%ICL#16$I=C+2I@<:Y108#&8S"1&(P4+ 92(SD8:#!X
M550IG0L+N]6Z U V@U: (?02=C8K_X9T)+H>L8S:I_32\Z#-3 '?;FJ\ 8YHX
M?SP+232> .>V"E(\0S?IX [2(U/D\196^"K9H?OR7I!,;XWMDD\\4[< A9Y[X
M_7G[;**@K.:\D*GS*:9XG41#RQA-"?N( I?(7]2YTHT.'H=R6Z;R*/O'JNY"X
M/5'<BX3!8^EV6.GQ$ J Y,XC<GD.&Q5\:LLVP;> NMHZG_3<VKKEVO<3S**SX
M">4PRM0HK9S&6 6=V!:T_8N5[G"%8R[BM9II=P!&,M-!KOVK,$>R_ G-@2%ZX
/0O#/MB^5]@C^,0_[D+P X
X
end
Oliver
Elaborate Bytes, Oliver Kastl >> Home is where the heart is... <<
--
Mark E Daniel (Loving SysOp of The Legend BBS)
Inet: ma...@legend.akron.oh.us "To the world he was the master/His landsca
pes
meda...@delphi.com (Direct INet)filled the gallery halls/Now he painted only
portrits/Framed upon his private walls/For a
kinder eye to see us not as we are but as we
dream" [Level 42 "A kinder eye"]
Or even better, with pipe-hack installed:
list ~(#?.(gif|jpg)) lformat "compress -b 16 -v %s" | execute in:
--
OBW
Well, I was trying to stick to stuff included with the OS as that was (to
my knowledge) part of the discussion. (How can you do xxx with the OS?)
--
// |
// Maxwell Daymon | Intel Inside:
\\ // mda...@rmii.com | It's not a trademark, it's a warning
\X/ |
: I have used # without ? on several occasions, so I think it is definately
: useful. For example, I have in the past had make files which used .o .oo &
: .ooo as object file extensions. (To make it easy to implement different
: optimization settings in the makefile.) and of course the easiest way to
: delete all the objects: delete #?.#o.
I have used the Amiga wildcard set extensively. I admit that I'm a
"hardcore" shell user, but why give up the power because some people
don't need it? I HATE MS-DOS wildcards - they are so primitive and simple.
Many people are starting to use very complex wildcards in the file
requesters to filter out or bring in certain filetypes. I only wish there
was a byte compare wildcard. (e.g. dir (@0:'FORM'&&8:'ANIM') would open
each file and check if FORM and ANIM were preset at the specified
offsets, other wildcards wouldn't be touch the files though).
I have used # without ? on several occasions, so I think it is definately
useful. For example, I have in the past had make files which used .o .oo &
.ooo as object file extensions. (To make it easy to implement different
optimization settings in the makefile.) and of course the easiest way to
delete all the objects: delete #?.#o.
----------------------------------------------------------------------------
Bradley A. Ross
Actually, they are too *simple*! At least, the implementation is. You can't
even write
#(#?/)#?.info
to select all .info files in all directories. Instead you need
#?.info ALL
in some commands, but this isn't supported everywhere.
Unrelated: why is it not possible to give a pattern to ALL as well? I mean,
if you have directories like Pictures_GIF and Pictures_JPEG,I'd like to write
dir ~(#?.info) ALL Picture#?
or something. Believe it or not, this bugs me from time to time.
Hans
>In article <31j2hp$4...@jhunix.hcf.jhu.edu> robo...@jhunix.hcf.jhu.edu (Zsolt Szabo) writes:
>[...]
> So then, is there a command that'll EXCLUDE certain files? For example,
> say I have a bunch of gifs and jpegs and iffs in my directory. Since the
> iffs don't have extentions, how can I compress them, without compressing
> the jpegs and the gifs?
>The tilde (~) is used for not, and the pipe (|) is used for or (as far
>as I can remember), so what you need to do is compress NOT(*.gif OR
>*.jpg), but I can't remember the syntax (you need some kind of
>brackets in there too). It's definitely possible, though; I have done
>it.
>--
For the record, probably the world and his wife has already posted this,
but it hasn't come up on this site yet...
"compress ~(#?.jpg|#?.gif)"
or "compress ~(*.jpg|*.gif)" if you have something nice like ToggleWC.
IMHO Unix badly needs equivalents to "~" and "|".
------------------------------------------------------------------------------
Dr Ian J Davenport NERC Unit for Thematic Information Systems
Email: i...@mail.nerc-nutis.ac.uk University of Reading, Reading, RG6 2AB
Tel: 0734 318741 Fax: 0734 755865
------------------------------------------------------------------------------
Oops. This is not what it's supposed to do. cbmnl and cbmger have a
direct connection. cbmnl should not remap an address to some invalid
form and should pass cbmger stuff directly to this machine and not
to sun4nl. Thanks for the investigation, I'll forward this internally,
and perhaps we can fix it.
: Unrelated: why is it not possible to give a pattern to ALL as well? I mean,
: if you have directories like Pictures_GIF and Pictures_JPEG,I'd like to write
: dir ~(#?.info) ALL Picture#?
I just made 3 directories: Clipboards, ce, and cr. I put different files
in each and typed:
dir c#?/~(#?.info)
and got a list of all the files in all the dirs that don't end with ".info"
Likewise, "dir picture#?/~(#?.info)" should work.
In article <OSMA.AHVENLAMP...@lk-hp-9.hut.fi>, Osma Ahvenlampi writes:
> True, in normal use, which can be understood as file name matching,
> the power of #? is pretty much wasted.
Untrue. In a news article tree, #[0-9] is convenient to refer to
articles (or news batches in UUNEWS:in.coming) as opposed to subdirec-
tories or newsreaders' index files.
> Using * for an escape
> character has to be one of the worst decisions that were made in
> designing AmigaDOS 1.0.
Actually its use as escape character in strings is YABR (Yet Another
BCPL Remnant).
-- __
__/// Arno Eigenwillig <ar...@yaps.dinoco.de> \\ Stamp out patents
\XX/ MIME & any PGP V2 supported * V:+49-2225-5870 \\ for algorithms!
Take me home to the Cyber City / where net access is free /
and newsreaders are pretty. / Oh, won't you please take me home...