Mike’s Linux Desktop Experiences

March 3, 2008

Searching for the OO doc I wrote on speedcontrol.c

Filed under: Uncategorized — Mr. Mike @ 11:13 am

Last month, I wrote some blurb about the program speedcontrol.c. I won’t get in to what it does here, hopefully I can find that article.

It’s not obvious to me that Nautilus will let me do this. So I’m trying the command line.

    mike@whitetower:~/Documents/lotd$ grep -r speedcontrol.c *

    mike@whitetower:~/Documents/lotd$ grep -r -i vlc *
    Binary file day 1/sound-daemon.odt matches
    Binary file day 4/dmix.odt matches

Well, that’s wrong. I forgot, odt files are zipped XML.

    mike@whitetower:~/Documents/lotd$ find ./ -name *.odt -exec zgrep -i vlc '{}' \;

Must not be searching all the contents

    mike@whitetower:~/Documents/lotd$ zcat "./day 1/vlc.odt"
    application/vnd.oasis.opendocument.textgzip: ./day 1/vlc.odt has more than one entry--rest ignored

Uh huh.

There must be an easier way.

    mike@whitetower:~/Documents/lotd$ OFS=$IFS; IFS='
    ' ; for i in `find ./ -name *.odt `; do unzip -p "$i" content.xml | grep -i vlc > /tmp/$$.find ; if [ -s /tmp/$$.find ]; then echo "$i"; fi; done; IFS=$OFS; rm /tmp/$$.find
    ./day 3/flash.odt
    ./day 4/moresound.odt
    ./0208/today.odt
    ./day3/flash.odt
    ./day 1/vlc.odt
    ./day 1/morestuff.odt
    ./day 1/sound-daemon.odt
    ./published/day 0/linux-on-the-desktop2.odt

So a search on “vlc” works.

    mike@whitetower:~/Documents/lotd$ OFS=$IFS; IFS='
    ' ; for i in `find ./ -name *.odt `; do unzip -p "$i" content.xml | grep -i speedcontrol > /tmp/$$.find ; if [ -s /tmp/$$.find ]; then echo "$i"; fi; done; IFS=$OFS; rm /tmp/$$.find
    mike@whitetower:~/Documents/lotd$

ok. No reference to it. Meh. I should be able to recall most of it and re-write.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: