* glob1 libs command arg ...
* Modified by: Bill Joy (UCB) Oct 1976
* takes library name string from the shell
* allows patterns to match directory names, i.e. "/mnt/c*?/.q"
* knows about pascal object and forks px's
char usagestr
[] "usage: glob2 libs command arg ...";
register char *cp1
, *cp2
, *cpl
;
while(*cp1
&& *cp1
!= '/')
execute(ava
[1], &ava
[1]);
while ((*cpl
& 0177) == ' ')
else if (cp1
>= &path
[PTHSIZ
-2])
if (cp1
>= &path
[PTHSIZ
])
if (cp1
>= &path
[PTHSIZ
])
execute(path
+4, &ava
[1]);
register char *file
, **arg
;
if (read(i
, &w
, 2) == 2 && w
== PCXN
)
register char **p1
, **p2
, **c
;
if (compar(*p1
, *p2
) > 0) {
while (*cs
!= '*' && *cs
!= '?' && *cs
!= '[') {
if (pathp
>= &path
[PTHSIZ
])
else if ((*pathp
++ = *cs
++) == 0) {
else if (stat(path
, &stbuff
) >= 0) {
while (cs
>= as
&& *cs
!= '/')
if (pathp
>= &path
[PTHSIZ
])
while (read(dirf
, &entry
, 16) == 16) {
if (match(entry
.name
, cs
)) {
*av
++ = cat(path
, entry
.name
);
panic("Arg list too long");
if (*s
== '.' && *p
!= '.')
if (lc
<= scc
&& scc
<= *p
++)
if (stat(path
, &stbuff
) == 0)
if ((stbuff
[2] & 060000) == 040000)
while (*s2
++ = (*s1
++ & 0177))