[PLUG] To bash or not to bash?
Bill Thoen
bthoen at gisnet.com
Sat Nov 7 16:55:18 UTC 2009
Michael Rasmussen wrote:
> On Sat, Nov 07, 2009 at 08:53:13AM -0700, Bill Thoen wrote:
>
>> $ ls -1 BLM/* | egrep ':$|\.shp' | grep -v \.xml
>> (list everything under the BLM directory but include only those lines
>> that end in a colon (the pathname) or contain a shapefile extension (.shp))
>>
>
> find . -name \*\.shp -o -type d
> sounds like what you're looking for
>
YES! Thanks for the fast response too. This works just about the way I
want it. Only one more step required and that's to filter out the lines
that have JUST the directory in them. Easy to do though. Just append "|
grep \.shp" and I've got Kibbles & Bits (well, the Bits at least) to
feed a hungry process.
BTW, that find command looks particularly useful. But I bet it can be
pretty dangerous if mis-handled. (like fire; a wonderful servant, but a
terrifying master.)
Regards,
- Bill Thoen
More information about the PLUG
mailing list