[plug] re: awk
Binh Nguyen
linuxfilesystem at yahoo.com.au
Mon Jul 21 09:25:12 WST 2003
>>> Start Program
> <snip!>
>
> It being a Sunday night, and me not having a lot to do, I decided to
> have a look into that Java program you posted. I don't know much
> about Java, and couldn't get your program to run (I spent some time
> installing the 'gjc' stuff, and only got loads of exceptions when I
> ran your code). Probably my environment - as I say, I don't really
> know what I'm doing with Java. However, having read the code, I think
> I worked out what it does. Those 100 odd lines of Java do this:
>
> perl -ne '/^Name\s*:\s(\w+)/ and print $1,"\n"'
>
> i.e. they print the names of the installed RPM packages without the
> version numbers, as the OP requested:
>
>> rpm -qa --info | perl -ne '/^Name\s*:\s(\w+)/ and print $1,"\n"'
> aaa_version
> OpenOffice_org
> filesystem
> release
> sash
> saxident
> ispell
> ...
>
> I can't help thinking that Java probably wasn't the best tool for
> this job...
>> o)
>
>> eatapple
> core dump
I know what you mean, but its been a while since I've actually done anything
useful in Java and I needed the practice :-)
Binh.
More information about the plug
mailing list