[nycbug-talk] pkg_info - oy

Jesse Callaway jesse
Mon Feb 23 21:07:23 EST 2004


> > > open PKG, "pkg_info |";
> > > while (<PKG>) {
> > >     s/^ +$//;   # theres a space between ^ +
> > >     print;
> > > }
>
> Forgot to mention before your RE is wrong, it says "from the begining of
> the line match all the spaces to the end of the line and substatute with
nothing"
> Try this one instead:
>
> /^(\S+)\s/
>
> ie
> pkg_info |perl -ne ' /^(\S+)\s/ ; print "$1\n";'

right, I guess I had a dot in there. I'll have to admit that I didn't
remember what I'd written or try to go through the (not very complicated)
logic of rebuilding it. Let's just say I was tired.

But this is  the kind of dialog I was looking for. And I really like that -

    echo *

which Jan wrote about. That's just about as pure as globbing could get.
Totally overlooked it. I never read a book about the shell.... and I'm not
sure which man page is the informative one for sh or bash. Whoops, I'm
wrong. The sh(1) page has this Grammar section which I've frankly never
seen. I've seriosly looked for it...

anyway, thank you for the responses

Now I'm off to try to boot up with the kernel which DOES have the Berkely
Fast File system aka Unix(tm)? File System (but not OPTION UFS! urg)

-jesse





More information about the talk mailing list