On Thursday, August 1, 2002, at 12:10 PM, Victor Eijkhout wrote:

> At 11:41 -0700 2002/08/01, Justin C. Walker wrote:
>> Try the following in a directory with file names some of which have 
>> spaces in them:
>>
>> for i in `find .`
>> do
>> echo === $i ===
>> done
>
> So don't do that.
>
> find . -exec echo ==={}=== \;

This version (of course) does the job.  After thinking this over, and 
contradicting my earlier suggestion that I have a life, I fiddled with 
Martin's script a bit.  I think it now works, but at a cost of a bit 
more complexity:

~/bin/grepbom:
#!/bin/sh
[ -z $1 ] && exec echo "usage: grepbom REGEXP"
find /Library/Receipts/ -name \*.bom -exec ~/bin/grepbom1 '{}' $1 \;
printf "\n"

~/bin/grepbom1:
#!/bin/sh
CR=1
echo -n "."
lsbom -p fST "$1" |grep $2 && printf "   ====> %s\n\n" $1 && CR=0
[ ${CR} -eq 0 ] &&  printf "\n"

> I'm sorry, I no longer know what the original problem was. Maybe this 
> solution also doesn't work there, but for another reason.

That's the problem with long threads...finding the beginning, once the 
end is near :-}.  The original problem was figuring out which package a 
particular file belongs to.  Martin offered his script, which worked 
well unless the package name (the 'foo' part of "/Library/Receipts/foo") 
had spaces in it.  This is fairly rare, but fink, for one, has `em.

There followed this "much ado about nothing" exchange which leads us 
here...

Regards,

Justin

--
/~\ The ASCII           Justin C. Walker, Curmudgeon-at-Large
\ / Ribbon Campaign
  X  Help cure HTML Email
/ \



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Fink-beginners mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-beginners

Reply via email to