Using bash, is there a way to produce a single-column file listing that includes the full path name for each file? I've got a directory of directories that I need to traverse and list all the Shapefiles (*.shp) it contains by subdirectory. The full path name is needed because it's going to feed the next process, which is to reproject the data The best I've been able to come up with is:
$ 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)) which produces the pieces I need: BLM/Areas_of_Critical_Env_Concern: BLM_ACECs_2009.shp BLM/BLM_ACEC: BLM_ACECs_2009.shp BLM/BLM_ALL: BLM_ALL_2005.shp BLM_CANCA_2008.shp BLM_CANCAp_2008.shp ... but what I want is: BLM/Areas_of_Critical_Env_Concern/BLM_ACECs_2009.shp BLM/BLM_ACEC/BLM_ACECs_2009.shp BLM/BLM_ALL/BLM_ALL_2005.shp BLM/BLM_ALL/ BLM_CANCA_2008.shp ... Is there something clever I can do to produce a file listing like the last one? I've looked trhough ]the man pages on ls, but either I just didn't understand what it said or I knew that the option wouldn't work. Or is this now a job for awk or something that can handle multiple records at a time? Thank you! -- - Bill Thoen GISnet - www.gisnet.com 303-786-9961 _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
