# Works much like xargs, but don't forget the flexibility of inserting# {} in the ensuing expression for the $line location.## Examples: http://www.haller.ws/logs/view.cgi/LearnToShootWithBasheach(){local line=""while read line; do# sub {} with $line and run it # eval "${@/\{\}/${line}}" eval"${@/\{\}/\"${line}\"}"# $@ =~ s/ {} / $line /done}
Here’s another code block, using Haskell:
Does it understand Haskell?
12345678910111213141516
-- Some random code from Newt:importTest.HUnit((@=?))importTest.Framework.Providers.HUnitimportTest.Framework(testGroup,Test)-- | Create a Test from a function, a description, an input, and an oracle:genTest::(Showa,Showb,Eqb)=>(a->b)->(String,a,b)->TestgenTestfn(descr,input,oracle)=testCase(descr++" input: "++showinput)assertwhereassert=oracle@=?fninputgenTestIO::(Showa,Showb,Eqb)=>(a->IOb)->(String,a,b)->TestgenTestIOfn(descr,input,oracle)=testCase(descr++" input: "++showinput)$dores<-fninputoracle@=?res
There are more examples of including code here: http://octopress.org/docs/blogging/code/