summaryrefslogtreecommitdiff
path: root/man/example-filter.sh
blob: 2a71d40d7c595fe9f21bdf1d78c93d979ed07b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# This is a super bootleg script for converting plaintext examples into groff.

while read line; do
	echo "$line" | while read -n 1 char; do
		if [[ $char == "%" ]]; then
			echo -n '%'
			continue
		fi
		ord=$(printf '%d' "'$char")
		if [[ $ord -eq 0 ]]; then
			printf ' '
		elif [[ $ord -gt 127 ]]; then
			printf '\[u%X]' "'$char"
		else
			printf "$char"
		fi
	done
	echo
	echo ".br"
done
c/password-store.sh?h=1.7.2&id=5f3e0b36af40c1fc5991fce76e9998313d36c6ee&follow=1'>Strip ".gpg" from symlinks as wellTheo Chatzimichos1-2/+2 2015-01-19clip: Show an error message if xclip returns a non-zero exit codeWieland Hoffmann1-3/+2 2015-01-19Correct path for top level grepJason A. Donenfeld1-2/+3