[comp.unix.questions] Bourne shell globbing

chris@mimsy.UUCP (Chris Torek) (08/01/89)

In article <2332@wyse.wyse.com> bob@wyse.wyse.com
(Bob McGowen x922-4312 Training) writes:
>If you are using the Bourne shell, the following pattern should work:
>
>	[!!-~].???
>
>The part to the left of the period says anything that is NOT (first
>exclamation) in the range exclamation to tilde.

The standard Bourne shell---that is, the one in Version 7; the one
in 4BSD is essentially identical---does not have negation in glob
patterns.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

dce@Solbourne.COM (David Elliott) (08/01/89)

In article <18846@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes:
>In article <2332@wyse.wyse.com> bob@wyse.wyse.com
>(Bob McGowen x922-4312 Training) writes:
>>	[!!-~].???
>>
>>The part to the left of the period says anything that is NOT (first
>>exclamation) in the range exclamation to tilde.

This one caught me by surprise.  I've been programming in the
Bourne shell for a long time, and I never saw this before.  Of
course, I haven't seen the need to reread the manual for quite
a while, so I could have easily missed it.

Is this standard in System V.2?  V.3?  Maybe it's just a SunOS-ism?
I'd sure like to be able to use it, but it would help to know
how widely it is available.

-- 
David Elliott		dce@Solbourne.COM
			...!{boulder,nbires,sun}!stan!dce

bob@wyse.wyse.com (Bob McGowen Wyse Technology Training) (08/02/89)

In article <1810@marvin.Solbourne.COM> dce@Solbourne.com (David Elliott) writes:
>In article <18846@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes:
>>In article <2332@wyse.wyse.com> bob@wyse.wyse.com
>>(Bob McGowen x922-4312 Training) writes:
>>>	[!!-~].???
--deleted--
>
>This one caught me by surprise.  I've been programming in the
>Bourne shell for a long time, and I never saw this before.  Of
--deleted--
>Is this standard in System V.2?  V.3?  Maybe it's just a SunOS-ism?
>I'd sure like to be able to use it, but it would help to know
>how widely it is available.
>

An earlier response to my first posting got me to wondering, so I
checked.  This works under XENIN 2.3.2 (also 2.2.x), SUN os (I don't
remember/know version), UNIX SVR3.2.  I also think/thought that
I had used this on BSD systems, but the earlier followup seems to
indicate this is not the case?  I have available to me a Fortune
Systems 32:16 with ForPro 1.7 (BSD derived version, I believe) and
I think it does this also.  But will check and confirm.  This
feature is NOT listed in the metacharacter table on page 76 of
Kernighan and Pike's _The UNIX Programming Environment_.

I have no idea where I first heard about it nor how available it is.

Cheers :-)

Bob McGowan  (standard disclaimer, these are my own ...)
Customer Education, Wyse Technology, San Jose, CA
..!uunet!wyse!bob
bob@wyse.com

davidsen@sungod.crd.ge.com (William Davidsen) (08/03/89)

  It's not in the "old" ksh, or ksh-88.
	bill davidsen		(davidsen@crdos1.crd.GE.COM)
  {uunet | philabs}!crdgw1!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

guy@auspex.auspex.com (Guy Harris) (08/03/89)

 >>>	[!!-~].???
 >>>
 >>>The part to the left of the period says anything that is NOT (first
 >>>exclamation) in the range exclamation to tilde.
 >
 >Is this standard in System V.2?  V.3?  Maybe it's just a SunOS-ism?

Yes, yes, and no.  It first appeared in System III.

rbj@dsys.ncsl.nist.gov (Root Boy Jim) (08/05/89)

? From: Guy Harris <guy@auspex.auspex.com>

?  >>>	[!!-~].???
?  >>>
?  >>>The part to the left of the period says anything that is NOT (first
?  >>>exclamation) in the range exclamation to tilde.
?  >
?  >Is this standard in System V.2?  V.3?  Maybe it's just a SunOS-ism?

? Yes, yes, and no.  It first appeared in System III.

Tcsh has a similar feature. `ls *.[^o]' will list any file with a
one char suffix except for onject files.

	Root Boy Jim
	Have GNU, Will Travel.