File: genh2m.sh

package info (click to toggle)
dateutils 0.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,924 kB
  • sloc: ansic: 22,097; makefile: 1,666; yacc: 198; sh: 168; lex: 108
file content (27 lines) | stat: -rwxr-xr-x 352 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

## usage gentexi BINARY
if test -x "${1}"; then
	BINARY="${1}"
	BINNAME=$(basename "${BINARY}")
	shift
else
	echo "${1} not a binary" >&2
	exit 1
fi

echo "[EXAMPLES]"
if test "${#}" -eq 0; then
	exit 0
fi

for i; do
	echo
	sed '/^#!/d; /ends here$/d; /^[ \t]*$/d;
s/@/@@/g; s/{/@{/g; s/}/@}/g
s/\\/\\\\/g
s/^/  /' "${i}"
	echo
done

exit 0