xref: /dflybsd-src/usr.bin/crunch/crunchgen/mkskel.sh (revision fc7e83fa167ace550636f25b513c873f2f3135ff)
1*fc7e83faSFrançois Tigeot#! /bin/sh
2*fc7e83faSFrançois Tigeot# idea and sed lines taken straight from flex
3*fc7e83faSFrançois Tigeot
4*fc7e83faSFrançois Tigeotcat <<!EOF
5*fc7e83faSFrançois Tigeot/* File created via mkskel.sh */
6*fc7e83faSFrançois Tigeot
7*fc7e83faSFrançois Tigeotchar *crunched_skel[] = {
8*fc7e83faSFrançois Tigeot!EOF
9*fc7e83faSFrançois Tigeot
10*fc7e83faSFrançois Tigeotsed 's/\\/&&/g' $* | sed 's/"/\\"/g' | sed 's/.*/  "&",/'
11*fc7e83faSFrançois Tigeot
12*fc7e83faSFrançois Tigeotcat <<!EOF
13*fc7e83faSFrançois Tigeot  0
14*fc7e83faSFrançois Tigeot};
15*fc7e83faSFrançois Tigeot!EOF
16