[brlcad-commits] SF.net SVN: brlcad:[37510] brlcad/trunk/TODO
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2010-01-29 23:40:47
|
Revision: 37510 http://brlcad.svn.sourceforge.net/brlcad/?rev=37510&view=rev Author: brlcad Date: 2010-01-29 23:40:41 +0000 (Fri, 29 Jan 2010) Log Message: ----------- flesh out even more details on a batch command. show how it relates to search and show how it could have really powerful stream processing capabilities of awk, sed, and cut. becomes a way to pipe and invoke ged commands without a shell. Modified Paths: -------------- brlcad/trunk/TODO Modified: brlcad/trunk/TODO =================================================================== --- brlcad/trunk/TODO 2010-01-29 23:09:09 UTC (rev 37509) +++ brlcad/trunk/TODO 2010-01-29 23:40:41 UTC (rev 37510) @@ -62,11 +62,36 @@ this would let you do things like: # same as mvall -f file.txt - batch file.txt -exec mvall {} \; + batch file.txt -exec "mvall \$*" + + # create an alternate hierarchy based on some mapping file + batch file.txt -exec "g \$*" # for all lines in 3 files, kill first symbol, rename second to it - batch A.txt B.txt C.txt -exec kill $1 \; -exec mv $2 $1 \; + batch A.txt B.txt C.txt -exec "kill \$1" -exec "mv \$2 \$1" + # keep all objects in an edcodes file with region ID > 1000 + batch A.txt -field 2 -ne 1000 -exec "keep subset.g \$5" + + # for all regions, if they are listed in file.txt, add them to a + # parent assembly and set a specified material ID + search . -name "*.r" -exec batch file.txt -field 1 -eq {} -exec "g \$1 {}" -exec "mater {} \$3" \; + + # run awk, get 4th column, run sed to change name, + batch file.txt -awk '{print $4}' -sed 's/^r\.(.*)/\1\.r/g' -exec "mv \$1 \$$" + + # outside of MGED, the above would have been similar to: + cat file.txt | awk '{print $4}' | sed 's/^r\.(.*)/r\.\1 \1\.r/g' | xargs mged test.g mv + + The command becomes more of a stream processor on the input file, as + if piped on the shell line. To embed awk, sed, cut, see qse: + http://code.google.com/p/qse/ + + The search and batch commands probably can't nor shouldn't use the + same replacement markers, with batch using $*, $1, $2, etc, to + represent file columns (in a poor man's awk fashion) and search + simply using "{}" as the the object name replacement marker. + * fix !!! in src/libged/tables.c where a temporary file is getting used. needs to call bu_temp_file(). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |