Skip to content

Instantly share code, notes, and snippets.

@CapnKernel
Last active September 15, 2015 17:42
Show Gist options
  • Select an option

  • Save CapnKernel/4fcae4007046a5eb7bd4 to your computer and use it in GitHub Desktop.

Select an option

Save CapnKernel/4fcae4007046a5eb7bd4 to your computer and use it in GitHub Desktop.
pcb-analyse.sh
#! /bin/bash
suitable_files0()
{
python3 -c 'import itertools,glob;f=itertools.chain.from_iterable(glob.glob("*.%s"%"".join(map(lambda c:"[%s%s]"%(c.lower(),c.upper())if c.isalpha()else c,ext)))for ext in "drl,dri,txt,cnc,gko,gbr,gol,out,gml,gm1,gm16,gt1,gto,gtp,gts,gtl,g1,gl1,gp1,g2l,gl2,gp2,g2,g3,g3l,gl3,gp3,gp4,gp5,gbo,gbp,gbs,gbl".split(","));print("\0".join(f), end="")'
}
echo "Which tool? (Enter to skip)"
select tool in gerbv gerbview analysefiles takepic rezip nautilus shell CleanAndExit; do
case $tool in
gerbv|gerbview)
suitable_files0 | xargs -0 $tool
echo
;;
analysefiles)
find * -type f -a '!' -regex '__stencil__/.*' -print0 | xargs -0 pcb-analyse
;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment